oatpp / oatpp-swagger

OpenApi 3.0.0 docs + Swagger UI for oatpp services
https://oatpp.io/
Apache License 2.0
90 stars 51 forks source link

Swagger resources for static binary use #44

Open elgatito opened 3 years ago

elgatito commented 3 years ago

Hello,

If we need to make static binaries - we get a situation when Swagger resources are not found locally on a running host. So it would be great to have a possibility to use CDN based resources and avoid searching for local resources.

Thanks

bamkrs commented 2 years ago

Hey, I just found this issue again and want to elaborate more on that. You can host the swagger-ui wherever you want. You do not need to ship it or have it with your application. Technically you could override oatpp::swagger:: resources to have them either served or redirected from an CDN and use this implementation in the swagger-component.

The best way would be to override oatpp:swagger::components to serve an static index.html (literally hard coded in your application) which pulls the swagger UI from an CDN and let the client side do the rest.

The only thing that is actually bound to your application is the OAS JSON file. So you're are completely free to host the UI wherever you want.