-
Notifications
You must be signed in to change notification settings - Fork 7
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
support for additionalItems #89
base: main
Are you sure you want to change the base?
Conversation
parser/src/json/schema.rs
Outdated
match (get("items"), get("additionalItems")) { | ||
(Some(items), None) => Some(items), | ||
(None, Some(additional_items)) => Some(additional_items), | ||
(Some(_), Some(_)) => { | ||
bail!("Cannot specify both 'items' and 'additionalItems'") | ||
} | ||
_ => None, | ||
}, |
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.
We could alternatively only look for the one that's valid under the detected draft? That being said, I don't think a lot of folks actually annotate their schema with the draft, so that may be kind of useless... thoughts @mmoskal ?
There is ~200 cases with
There is in fact only 4 cases with additionalItems being an object:
|
@mmoskal I was mistaken about the semantics of https://json-schema.org/understanding-json-schema/reference/array
I'm still a bit confused about the semantics between draft 4 and 6... |
closes #86