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 does not render OpenAPI Definitions #2924

Open
madduci opened this issue Feb 27, 2025 · 0 comments
Open

Swagger UI does not render OpenAPI Definitions #2924

madduci opened this issue Feb 27, 2025 · 0 comments

Comments

@madduci
Copy link

madduci commented Feb 27, 2025

Hello

I have a Spring 3.4.3 Application that has as dependencies both

  • springdoc-openapi-starter-webmvc-api 2.8.5
  • springdoc-openapi-starter-webmvc-ui 2.8.5

The UI is available at the address /swagger-ui/index.html, but i receive the following error:

Unable to render this definition

The provided definition does not specify a valid version field.

Please indicate a valid Swagger or OpenAPI version field. Supported version fields are swagger: "2.0" and those that match openapi: 3.0.n (for example, openapi: 3.0.0).

At the address /v3/api-docs i can see the OpenAPI Definition, which uses the Version 3.1.0:

{ "openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"}, .. }

To Reproduce
Steps to reproduce the behavior:

  • SpringBoot 3.4.3 Project with Actuator and SpringDoc enabled
  • Java 21 Temurin Runtime
  • SpringDoc 2.8.5 Modules: springdoc-openapi-starter-webmvc-api and springdoc-openapi-starter-webmvc-ui
  • The expected OpenAPI definition is working correctly (Version 3.1.0 of OpenAPI), saying openapi: 3.1.0
  • Accessing /swagger-ui/index.html, an Error saying that The provided definition does not specify a valid version field. is shown

Expected behavior

  • The Swagger UI should render the generated OpenAPI Definition

Screenshots

Swagger UI:
Image

OpenAPI Definition:
Image

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

1 participant