How does !include works?


#1

I use api-designer from apihub.com, I want to include external JSON file as the response.

    responses:
      200:
        description: blah
        body:
          application/json:
            example: !include https://gist.github.com/kukat/7941074/raw/c019488a6258884b475f70eda95b2a0f0a5b0cd5/ifconfig.all.json

And i get this error.

cannot fetch https://gist.github.com/kukat/7941074/raw/c019488a6258884b475f70eda95b2a0f0a5b0cd5/ifconfig.all.json (NetworkError: A network error occurred.)


#2

Looks like a cross domain error. No CORS support yet I guess. Your syntax is correct but it has to reference a file on www.apihub.com. Note this is just a designer issue. Other tools should handle your include above with no issues.


#3

Is there any reason why a locally running API Designer would not be able to include a file from an HTTP path on the same local system?