2

Conside this OpenAPI schema:

Units:
  type: array
  properties:
    empty:
      type: boolean
  items:
    $ref: '#/components/schemas/Unit'

Swagger Editor renders it as follows:

result in right schema pane in Swagger Editor

How should I interpret the 'empty' property ? Why is it seen as an ordered map?

Normally an array has items but no direct properties in it.

Helen
  • 87,344
  • 17
  • 243
  • 314
moverbk
  • 21
  • 3

1 Answers1

1

In this schema, the properties section is effectively ignored. The properties section has effect only for type: object and in typeless schemas, but it's not used with arrays. So this definition is equivalent to:

Units:
  type: array
  items:
    $ref: '#/components/schemas/Unit'

The "OrderedMap" text in Swagger Editor's model renderer can be considered a display bug. Feel free to open an issue for this here: https://github.com/swagger-api/swagger-ui/issues

Helen
  • 87,344
  • 17
  • 243
  • 314