Skip to content

reference name is not displayed in OpenApi 3.1.0 renderer #9540

@ivan-klass

Description

@ivan-klass

Q&A

  • OS: macOS
  • Browser: chrome
  • Version: 121.0.6167.139
  • Method of installation: dist, cloud
  • Swagger-UI version: any recent version, (checked from 5.2 to 5.10.3)
  • Swagger/OpenAPI version: 3.1.0

A simple example Swagger/OpenAPI definition:

openapi: 3.0.3
info:
  title: Example
  version: 0.0.1
paths:
  /api/v1/example:
    get:
      operationId: example
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Node'
components:
  schemas:
    Node:
      required:
      - id
      type: object
      properties:
        id:
          $ref: '#/components/schemas/NodeId'
        name:
          type: string
        parentId:
          $ref: '#/components/schemas/NodeId'
    NodeId:
      type: integer
      description: Internal ID of a Node
      format: int32

Describe the bug you're encountering

When switching openapi: 3.0.3 to 3.1.0 renderer no more displays references with their names.

Expected behavior

Referenced types are shown with their name so it's easy to see reused components

To reproduce...

Use a provided example and compare results between 3.0.3 and 3.1.0

Actual behavior

Referenced types are inlined without name (e.g. NodeId in provided simple example) - hard to see common components when using complex schemas.

Screenshots

Screenshot 2024-01-31 at 14 25 49 Screenshot 2024-01-31 at 14 25 06

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions