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-ui compatibility #457

Closed
jessebutterfield opened this issue Jun 7, 2022 · 4 comments
Closed

Swagger-ui compatibility #457

jessebutterfield opened this issue Jun 7, 2022 · 4 comments

Comments

@jessebutterfield
Copy link

Swagger UI has by default turned off controlling the default url with query parameters (see GHSA-qrmm-w75w-3wpx). So any version of swagger-ui > 4.1.2 using the setup in 3b will default to showing swagger's example pet store instead of your local swagger definitions.

@Javakky-pxv
Copy link
Collaborator

Javakky-pxv commented Jun 27, 2022

@jessebutterfield
I had the same problem.
I copied index.html and swagger-initializer.js locally and rewrote SwaggerUIBundle#url.

Do you know of any other countermeasures?

@jessebutterfield
Copy link
Author

I tried a couple of different things but I didn't come up with anything I liked better than that, so I also just ended up copying and editing swagger-ui/index.html.

@Javakky-pxv
Copy link
Collaborator

@jessebutterfield
The above has been added to the README.

@DraganRaicici
Copy link

DraganRaicici commented Mar 10, 2023

Hi there.

I'm not sure I understand what you guys mean by "I copied index.html and swagger-initializer.js locally"...
Do you mean we should create a new route that points to that newly copied index.htmlfile with the modified swagger-initializer.js?

If so, I also have to copy over the swagger-ui-bundle.js, swagger-ui-standalone-preset.js files, the favicons and the swagger-ui.css file as well.

I must be misunderstanding the solution since this seems a little over the top.

Also, if I may, can you please review the README?
This sentence does not make sense:
"Copy the index.html and swagger-initializer.js generated in target/${project}/public/lib/main/swagger-ui/ and modify the js files as follows to create Swagger-UI can be used easily."

More specifically: "...modify the js files as follows to create Swagger-UI can be used easily."

For more information: my project is a REST api with no views and it's running on Scala version 2.13.10, Play version 2.8.19 and sbt-play-swagger version 1.0.0

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

3 participants