no-invalid-media-type-examples error for schema with oneOf (with discriminator) containing other schema with allOf #1232
Labels
governance
Issues relating to problems with or requests for API governance/linting/decorating
p2
question
Further information is requested
Type: Bug
Something isn't working
Describe the bug
When defining a property that can be
oneOf
several schemas with a discriminator property and if one of the possible schemas is defined viaallOf
, then examples for the resulting schema fail validation due to a supposedly missing property on the contained allOf-Schema, even though it exists.Apart from the error being incorrect, the reported error location is also very far from the source of it and it was difficult tracking this down to the actual cause in a complex nested schema.
To Reproduce
Steps to reproduce the behavior:
redocly.yaml
fileRun this command with these arguments...
redocly ...
redocly lint minimal_error.yaml
I suppose (I'm usingnpx @redocly/cli lint minimal_error.yaml
)See error
Expected behavior
No error. The reference schema has the required discriminator property.
Logs
This is the actual output:
Redocly Version(s)
1.0.2
Node.js
Version(s)v18.17.0
Additional context
The text was updated successfully, but these errors were encountered: