Skip to content
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

$merge/$patch pre-processing keywords for schema extension #231

Closed
epoberezkin opened this issue Jul 12, 2016 · 3 comments
Closed

$merge/$patch pre-processing keywords for schema extension #231

epoberezkin opened this issue Jul 12, 2016 · 3 comments
Labels

Comments

@epoberezkin
Copy link
Member

Proposed by @fge

The reason to implement them is to allow to extend existing schemas (e.g. meta-schemas, but equally important for any large schema).

For non-recursive schemas allOf/anyOf keywords can be used, but for recursive schemas there is no extension mechanism.

https://github.com/daveclayton/json-schema-validator/wiki/v5:-merge
https://groups.google.com/forum/#!topic/json-schema/sztyQoNlnDM

@fge, syntax you propose is a bit ambiguous, it would be good to clarify and add to v5 proposals page.

@epoberezkin epoberezkin changed the title $merge/$patch pre-processing keywords for schema extensions $merge/$patch pre-processing keywords for schema extension Jul 12, 2016
@yyscamper
Copy link

yyscamper commented Jul 17, 2016

+1, I am also looking forward to this feature. In my case, the additionalProperties doesn't work as my expectation when I use the allOf to merge two-schemas, but merge can.

@epoberezkin
Copy link
Member Author

For small/non-recursive schemas you own you can always refactor at least...

@epoberezkin
Copy link
Member Author

See $merge and $patch keywords.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants