Haufe-Lexware / wicked.haufe.io

An API Management system based on Mashape Kong
http://wicked.haufe.io
Other
123 stars 37 forks source link

API spec with separate common files #209

Open rshrimp opened 5 years ago

rshrimp commented 5 years ago

Hi Wicked While configuring my APIs, I realized that I cannot add a common file (OAS2.0) which contains some global components for e.g. date-time, phone number, etc. which are used in the API spec and referred through $ref. Does Wicked not allow $ref outside of the current api file? Swagger-UI throws all kinds of errors due to this.

I looked at the directory structure which stores directories for each api and copied the common files but still not able to make swagger-ui work and thus apis are broken. Help appreciated Thank you

DonMartin76 commented 5 years ago

Yes, you're probably right on this one. When this was initially implemented one or two years ago, this was actually not possible (afaik). Thus, wicked does not yet have any support for it. It expects the swagger/OpenAPI file to be self-sufficient.

Ideas how a solution for this could look like? Swagger-UI pulls the files from the UI container via an endpoint, and this endpoint does currently not support pulling other references from somewhere else. If you provide fully qualified references to some other place, it might work, but I haven't tried it.