Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger resources for static binary use #44

Open
elgatito opened this issue Apr 6, 2021 · 1 comment
Open

Swagger resources for static binary use #44

elgatito opened this issue Apr 6, 2021 · 1 comment

Comments

@elgatito
Copy link

elgatito commented Apr 6, 2021

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
Copy link
Member

bamkrs commented Jul 9, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants