Skip to content

'required' keyword doesn't work with referenced object #2270

@pangoyal

Description

@pangoyal

required doesn't work in the use case below

    type: object
    properties:
      models:
        type: array
        items:
          $ref: '#/definitions/model'
        required: [name]

nor like this

        items:
          allOf:
            - $ref: '#/definitions/model'
          required: [name]

but works indirectly like this

    type: object
    properties:
      models:
        type: array
        items:
          $ref: '#/definitions/temp'

temp:
  allOf:
  - $ref: '#/definitions/model'
  - required: [name]

Any idea? I think the array causing the problem

  • swagger-ui version: 2.1.8-M1

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