Closed LasneF closed 1 year ago
Hey! You could change the severity of the rule if you expect some examples to be invalid. In your ruleset, you could change the severity to warn.
"oas3-valid-media-example": "warn"
Alternatively, if address
is not a required property in the user schema, you could skip the address
in the example in order to avoid the violation of that rule.
LMK if you have any questions.
according to AJV , if schema is set to object , the payload cannot be null
so here the solution is to set address: type: [ object , null ]
there are severals interpretations here, #no academic battle :) , i close the issue
thx
Describe the bug rules oas3-valid-media-example is too picky with null value
To Reproduce given the below scheam and example
BOB is correct but ALICE is spot as an ERROR
within the following message error oas3-valid-media-example "address" property type must be object paths./user.get.responses[200].content.application/json.examples.ALICE.value.address
Expected behavior this should not trigger this rules but a dedicated one , may be as warning , that example should not use null value