swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26.59k stars 8.96k forks source link

OpenAPI 3.1.0 support: Schemas titles are no more displayed #9308

Open kekel87 opened 1 year ago

kekel87 commented 1 year ago

Q&A

Content & configuration

Example Swagger/OpenAPI definition:

openapi: 3.1.0
...
components:
  schemas:
    response-wrapper:
      title: ResponseWrapper
      type: object

Swagger-UI configuration options:

SwaggerUIBundle({
    url: "open-api.yaml",
    dom_id: "#swagger-ui",
    filter: true,
    docExpansion: "list",
    deepLinking: true, 
    presets: [
      SwaggerUIBundle.presets.apis,
      SwaggerUIBundle.SwaggerUIStandalonePreset,
    ],
    plugins: [SwaggerUIBundle.plugins.DownloadUrl],
});

Describe the bug you're encountering

While upgrading to OpenAPI version 3.1.0, the titles of the schemas are no longer displayed.

image

Instead, I see the path specified in the components/schemas (response-wrapper).

If I revert to version 3.0.0, it works again.

To reproduce...

Steps to reproduce the behavior: Upgrade to OpenAPI version 3.1.0.

Expected behavior

I should see the contents of the title property displayed:

image

kekel87 commented 8 months ago

Any news on this issue? It's still present with current latest version 5.11.8.