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

Invalid Swagger UI index.html for versioned API #1321

Closed
davidsonnabend opened this issue Nov 28, 2023 · 0 comments · Fixed by #1322
Closed

Invalid Swagger UI index.html for versioned API #1321

davidsonnabend opened this issue Nov 28, 2023 · 0 comments · Fixed by #1322

Comments

@davidsonnabend
Copy link
Contributor

Expected Behavior

A valid Swagger UI index.html will be created when API versioning is enabled.

Actual Behaviour

Wenn API versioning is enabled the generated Swagger UI contains an invalid SwaggerUIBundle configuration so that the browser show an empty site cause by a JavaScript error ("Uncaught SyntaxError: Unexpected number").

Steps To Reproduce

  1. Create micronaut application with versioned API, OpenAPI config and a simple controller (see example application)
  2. Run ./gradlew run
  3. Goto http://localhost:8080/swagger-ui/
  4. Open browser console an see the error: Uncaught SyntaxError: Unexpected number

Environment Information

Operating System: Ubuntu 23.10
JDK Version: 21.0.1-zulu

Example Application

https://github.com/davidsonnabend/micronaut-swaggerui-versioned-api-bug

Version

4.2.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

Successfully merging a pull request may close this issue.

1 participant