Skip to content

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

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions