Issue with required fields in schema function #2590
Unanswered
jcdebosschere
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm in trouble with this rule:
I'm trying to validate that part of an OAS:
I'm getting the following errors when linting:
(...) Non-error response MUST contain a standard object with data and metadata properties. Details: "schema" property must have required property "metadata" paths./documents.post.responses[201].content.application/json
(...) Non-error response MUST contain a standard object with data and metadata properties. Details: "schema" property must have required property "data" paths./documents.post.responses[201].content.application/json
I have Jest test cases that validate the rule. If I remove the 'required' elements in the rule, there is no error but the tests are failing because having just one of data or metadata is considered as OK, which is not the goal.
Adding ".schema" at the end of the 'given' clause doesn't help neither.
I'm really out of clue and any help would be very appreciated.
Beta Was this translation helpful? Give feedback.
All reactions