Skip to content

Example object of a complex object with $ref #2269

@pangoyal

Description

@pangoyal

Is it possible for swagger-ui to display example of a complex object which has referenced properties. Something like this.

  Model:
    type: object
    properties:
      id:
        type: integer
        description: model
      name:
        type: string
        description: Name of the model
    example:
      id: 1
      name: model1

  Models:
    type: object
    properties:
      prop1:
        type: array
        items:
          $ref: '#/definitions/Model'
      prop2:
        type: string
    example:
      prop1:
        - $ref: '#/definitions/Model'
      prop2: 'dummy value'

Swagger-ui version 2.1.8-M1

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