-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add JSON Schema misconfigurations rules #33
Conversation
adamaltman
commented
Apr 10, 2024
- https://apisyouwonthate.slack.com/archives/C0HGLHK0B/p1712304065817669
- https://apisyouwonthate.slack.com/archives/C0HGLHK0B/p1712405606458459
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments.
f292505
to
6c9f654
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good addition, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice - and I immediately caught a problem with the Museum API while testing this :)
fe772e4
to
d91ad7c
Compare
Nice! did you omit |
this throws a false positive with the following schema rule/json-schema-array-misconfiguration:
subject:
type: Schema
where:
- subject:
type: Schema
property: type
assertions:
const: array
assertions:
disallowed:
- properties type: object
properties:
thing:
type: array
items:
type: object // if this line is present, the error goes away. But this is not mandatory by the JSON Schema spec.
properties: {} also throws with this schema allOf:
- type: object
- properties: {} |
This rule throws a false positive
type: object
properties:
thing3:
items:
properties: {} |
These are good points and might be added to the README. However, if I'm the type of person who has advanced lint rules, I'm probably the type of person who requires I did intentionally omit message and severity (defaults to |