jensoleg / swagger-ui

Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
http://swagger.io
Other
1.14k stars 310 forks source link

Not working enum references #85

Open piotrjozwiak opened 7 years ago

piotrjozwiak commented 7 years ago

Hi everybody I have problem with enum references. I use referencing like this:

swagger: '2.0'
info:
  version: 1.0.0
  title: Pets Store
paths:
  /pets:
    get:
      responses:
        200:
          description: Returns all the pets
          schema:
            $ref: '#/definitions/List'
        201:
          description: Returns all the pets
          schema:
            $ref: '#/definitions/Set'

definitions:
  List:
    type: string
    enum: &my-list
      - one
      - two
      - three
  Set:
    type: string
    enum: *my-list

So declaration has name started with & and reference starts with * . It works well on swagger but does not work on your UI. I get well response sample but on response schema i have:

Can be m, y, -, l, i, s, t instead of referenced enums.