Skip to content

Avoid warning on inherited properties (allOf) #528

@cvgaviao

Description

@cvgaviao

In the schemas below we can see an inheritance scenario:

components:
  schemas:
    person:
      allOf:
        - $ref: '#/components/schemas/personForCreation'
        - type: object
          properties:
            id:
              type: integer
              format: int32
          required:
            - id

    personForCreation:
      allOf:
        - $ref: '#/components/schemas/personForUpdate'
        - type: object
          properties:
            creationDate:
              type: string

          required:
            - creationDate
            - firstName     <- warning
            - name           <- warning
            - email           <- warning

    personForUpdate:
      type: object
      properties:
        firstName:
          type: string
          maxLength: 255
        name:
          type: string
          maxLength: 255
        birthDate:
          type: string
          format: date
        address:
          type: string
          maxLength: 255
        postalCode:
          type: string
          maxLength: 255
        city:
          type: string
          maxLength: 255
        phoneNumber:
          type: string
          pattern: ^((\+)33|0)[1-9](\d{2}){4}$
        email:
          type: string
          format: email
        nationality:
          type: string
          maxLength: 255

The oas3 editor is showing a warning in the personForCreation complaining about missing properties. but they are supposed to be inherited.

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