-
Notifications
You must be signed in to change notification settings - Fork 141
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
Rule no-invalid-media-type-examples check fails on example with combination of two anyOf objects #1658
Comments
This configuration is overriding the schema constraints. no-invalid-parameter-examples:
severity: error
allowAdditionalProperties: false set it to true and it will work per the schema. This was a design decision by the tooling to enforce |
This seems like a workaround, neither property is "additional" in this specification and the intent is to explicitly allow only these properties in any combination. |
This is not a workaround, this is changing the default behavior of a decision made by the tooling vendor to override the JSON Schema default behavior. You need to explicitly set the tooling to follow the JSON Schema rather than their own behavior. |
Hey @jeremyfiel Is that right? |
@ipletnjov-tw the only behavior modified is the use of additionalProperties but that has an impact on other JSON Schema keywords and affects their behavior too. To clarify, Redocly does not "turn off" the use of JSON Schema, |
@jeremyfiel in this case it should be @ipletnjov-tw in your case you can also switch to the default JSON Schema behaviour by explicitly adding |
Actually, I think |
Describe the bug
Given a request body specification consisting of an
anyOf
of two objects, it is expected that a merged object consisting of the fields of both objects should be valid. However, theno-invalid-media-type-examples
rule fails when given an example with such a merged object.To Reproduce
This is the full ruleset we use, applied to a simplified version of our specification.
redocly.yaml
spec.yml
When running
redocly lint spec.yml --config redocly.yaml
, the validation fails:Expected behavior
Example 3 (combination of the two
anyOf
options) should be considered valid by the linter.Redocly Version(s)
1.19.0
Node.js
Version(s)22.4.0
The text was updated successfully, but these errors were encountered: