-
Notifications
You must be signed in to change notification settings - Fork 148
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
OAS 3.1 - arbitrary schema keywords are classified as lint errors #1546
Comments
Interesting. I didn't know arbitrary keys are allowed in Schema Objects. Could you share where exactly in the specification this is mentioned? |
@tatomyr Thanks for the quick response! Here's the ref from the spec. Typos would still be detected in most cases since schema definitions would be missing required properties. Obviously my preference here is that ReDocly strictly adheres to the specification by default 🙏 (rules can always toggle certain behaviors) |
Thanks for the link @Drew-Kimberly! I'm still not sure if we want to change the behaviour. Let's wait until we get more votes for that. Meanwhile, you can tweak the behaviour by supplying the type extension via a plugin. I understand it won't change the default settings but most users don't need those additional keys (or they can use specification extensions instead; BTW, could the specification extension cover your case?). |
This is currently breaking for mere on a property that has a "confirmedAt": {
"type": "string",
"description": "something something",
"nullable": true,
"example": "2024-07-01T14:00:00Z"
} |
I am not in support of changing the default behaviour because I think it works well for the majority but I can see the point that these are valid descriptions. The approach of using type extensions (especially if you use a few known keywords) is a very good workaround in the short term. However we should figure out a way to add a rule that relaxes these checks, so users can easily choose the behaviour that's right for them. @MorelSerge thanks for the example, since |
Describe the bug
For OAS 3.1, arbitrary keywords within schemas produce lint errors. This contradicts the 3.1 specification.
To Reproduce
Using
minimal
, this example spec from OpenAPI fails linting when it should pass.Expected behavior
The spec should pass linting.
Logs
OpenAPI description
3.1
Redocly Version(s)
@redocly/openapi-core@1.12.0
The text was updated successfully, but these errors were encountered: