Skip to content

Responses are not render if OpenAPI Reponses object contains extensions #10561

@alexandre-baron

Description

@alexandre-baron

Q&A (please complete the following information)

  • OS: Linux
  • Browser: Chromium
  • Version: 139
  • Method of installation: Embedded in Quarkus
  • Swagger-UI version: 5.20.8
  • Swagger/OpenAPI version: OpenAPI 3.1.0

Content & configuration

Example Swagger/OpenAPI definition:

{
  "openapi" : "3.1.0",
  "paths" : {
    "/hello" : {
      "get" : {
        "responses" : {
          "200" : {
            "description" : "The hello message",
            "content" : {
              "text/plain" : {
                "schema" : {
                  "type" : "string"
                }
              }
            },
            "x-tenant" : "acme"
          },
          "500" : {
            "description" : "Internal server error",
            "x-tenant" : "acme"
          },
          "x-tenant" : "acme"
        },
        "x-tenant" : "acme",
        "summary" : "Hello",
        "tags" : [ "Example Resource" ]
      }
    }
  },
  "info" : {
    "title" : "prout-quarkus API",
    "version" : "1.0-SNAPSHOT"
  }
}

Describe the bug you're encountering

The presence of extensions field in Responses object replace the rendering of responses by the following error message : 😱 Could not render responses_Responses, see the console.
OpenAPI specification allow usage of extensions in Responses object (cf. OpenAPI documentation).

I've opened an issue in smallrye-open-api repository that describe this bug in a more Java way (cf: smallrye/smallrye-open-api#2349).

To reproduce...

Steps to reproduce the behavior:

  1. Copy the previous OpenAPI specification into a SwaggerUI editor
  2. Open the operation

Expected behavior

SwaggerUI must render or ignore extensions in Responses object.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions