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

Required properties in 3.1.0 spec not working when used as sibling #2527

Open
josefguenther opened this issue Apr 24, 2024 · 0 comments
Open

Comments

@josefguenther
Copy link

Describe the bug
When referencing another object without nesting in allOf (3.0 spec), Open API 3.1 spec allows us to declare required properties as sibling alongside $ref like this:

components:
  schemas:
    CreateAlbum:
      required: [ Description ]
      $ref: "#/components/schemas/Album"
    Album:
      type: object
      properties:
        Id:
          type: string
          readOnly: true
        Description:
          type: string

Expected behavior
In route request body, using CreateAlbum should show Description as being required. However, it only works when $ref is nested in allOf, like this:

    CreateAlbum:
      required: [ Description ]
      allOf: 
        - $ref: "#/components/schemas/Album"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant