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

resource-object-id-required triggering on schemas using 'allOf' #64

Open
marquje opened this issue Jan 24, 2024 · 1 comment
Open

resource-object-id-required triggering on schemas using 'allOf' #64

marquje opened this issue Jan 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@marquje
Copy link
Collaborator

marquje commented Jan 24, 2024

Rule: resource-object-id-required is triggering on allOf items that fail the rule even though another item passes the check:

Example doc snippet:

MyResourceResponseObject:
      allOf:
        - $ref: '#/components/schemas/IdentifierObject'
        - type: object
          required:
            - attributes
            - relationships
          properties:
            type:
              enum:
                - resources
            attributes:
              type: object
              required:
                - name
              properties:
                account_id:
                  type: string
                name:
                  type: string
                  example: do-hickey
                description:
                  type: string
                  example: thing that does stuff

The rule checks for the presence of id, in the above example the $ref item contains the id, the rule continues to try and validate the second item which fails and throws the alert.

Expected behavior: schema passes as one of the items meets the id requirment.

@marquje marquje added the bug Something isn't working label Jan 24, 2024
@marquje
Copy link
Collaborator Author

marquje commented Jan 24, 2024

Looking into this... Currently the rule has been lowered to warn to alert user to verify the error, but not force a block.

@marquje marquje changed the title Rule: resource-object-id-required triggering on schemas using 'allOf' resource-object-id-required triggering on schemas using 'allOf' Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant