swagger-parser icon indicating copy to clipboard operation
swagger-parser copied to clipboard

reference name is not displayed to $ref in local file

Open SergeyDorozhko opened this issue 5 months ago • 0 comments

There is a simple example:

I have specification:

openapi_test.yaml:

openapi: 3.0.3
info:
  title: test
  description: test
  version: 1.0.0
servers:
  - url: '/'
tags:
  - name: test1
    description: "test"
paths:
  /test/v1/client:
    get:
      tags:
        - test1
      operationId: getClient
      responses:
        "200":
          description: "success"
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetClient200Response'


components:
  schemas:
    address:
      $ref: './address.yaml'

    GetClient200Response:
      type: object
      properties:
        address:
          $ref: '#/components/schemas/address'
        address2:
          $ref: '#/components/schemas/address2'
      required:
        - data

    address2:
      type: object
      properties:
        street:
          type: string
        building:
          type: string

./address.yaml:

type: object
properties:
  street:
    type: string
  building:
    type: string

When swagger rendering this spec it looks like:

Image

I want swagger to display referance name for all linked schemas in UI. What I do in wrong way?

SergeyDorozhko avatar May 06 '25 07:05 SergeyDorozhko