-
-
Notifications
You must be signed in to change notification settings - Fork 308
Extending properties #321
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
Comments
Maybe: |
Nice @epoberezkin I was literally thinking about suggesting this last night only as $extends where it $ref'd a schema and it's own properties overrode any on the one it was extending. for example
But I can certainly see benefit in selecting optional include and exclude as well so I'd be supportive of this if allowing extension was the default. Do you see any issues with making $ref behave differently based on another param in regards to backwards compatibility? |
VOTE-A-RAMA!!! It's time to gauge community support for all re-use/extension/additionalProperties proposals and actually make some decisions for the next draft. Please use emoji reactions ON THIS COMMENT to indicate your support.
This is not a binding majority-rule vote, but it will be a very significant input into discussions. Here are the meanings for the emojis:
If you want to explain in more detail, feel free to add another comment, but please also vote on this comment. The vote should stay open for several weeks- I'll update this comment with specifics once we see how much feedback we are getting and whether any really obvious patterns emerge. |
This suggestion does seem slightly confusing in that it seems to use the If this is added, my preference would be for this to be two keywords (e.g. |
@erayd thanks! I think we really just need to gauge support for general directions at this point. Nearly all of the proposals would need at least a little more work. Thanks for the clarification! |
Yeah, I got that impression while reading over the proposals and voting. It does look like things are moving along on this though, which is nice - I badly want some kind of inheritance-with-override mechanism, so very pleased to see some action happening in this area. |
Closing this as everyone who voted, including the author, voted against it :-) |
thumb-down wasn't "against" according to your legend ;) |
Well, not quite "against", but given the competition, if the best an idea can get is "Meh, I won't give up on the project if this is implemented" then it's not worth keeping. Although when I get around to consolidating the ideas for draft-08 feel free to take another run at it, I suppose. Actually I'm really hoping someone else will run draft-08 validation. |
Allow adding property schemas in referenced schemas.
That's one more solution to solving additionalProperties problem, somewhat similar to $params discussed with @handrews (#322). Also can be seen as implementation of a more generic #313.
Example:
Schema 2 explicitly allows extension (maybe it should be allowed by default and to prohibit extension you have to explicitly use
"$extend": false
(to prohibit extension of any keyword) or"$extend": {"properties": false}
(to prohibit extension of properties only).Schema 1 references schema 2 and extends properties.
Probably other keywords can be extended in a similar way: patternProperties, required, dependencies, enum, type (with array syntax? more for consistency), items (with array syntax), anyOf, etc. - essentially any keyword that takes a structured value but not a schema.
The text was updated successfully, but these errors were encountered: