Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid warning on inherited properties (allOf) #528

Open
cvgaviao opened this issue Feb 17, 2021 · 0 comments
Open

Avoid warning on inherited properties (allOf) #528

cvgaviao opened this issue Feb 17, 2021 · 0 comments

Comments

@cvgaviao
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant