Skip to content

Does json-schema-validator support $merge keyword? #200

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

Closed
xbmono opened this issue Aug 17, 2016 · 4 comments
Closed

Does json-schema-validator support $merge keyword? #200

xbmono opened this issue Aug 17, 2016 · 4 comments

Comments

@xbmono
Copy link

xbmono commented Aug 17, 2016

From the wiki page, it seems it does:

https://github.com/daveclayton/json-schema-validator/wiki/v5:-merge

However, I get error when using $merge and "with" in my schema

"the following keywords are unknown and will be ignored: [$merge]"

Have I missed anything? Any specific configuration?

Using the latest version 2.2.6

@xbmono xbmono changed the title Does validator support $merge keyword? Does json-schema-validator support $merge keyword? Aug 17, 2016
@xbmono
Copy link
Author

xbmono commented Aug 23, 2016

Any update on this? Any one knows? I really need to know to make decision whether to use $merge or not

@VamshiNaidi
Copy link

@xbmono Did you get an update on this ever? Can we use $merge with in the schema? Can you alos please share if you had opted for any other alternatives? Thanks in advance.

@handrews
Copy link

@xbmono @VamshiNaidi it is very unlikely that $merge will be added to the JSON Schema specification (I'm one of the primary spec maintainers). Most use cases that caused people to want it should be addressed by other proposals once we publish draft-08.

I would strongly recommend against using $merge, and if you explain your use case a bit more I can provide additional advice on how to handle it. (although I don't have any info on when or whether this implementation will support newer drafts- I believe the maintainer has asked for PRs for that).

@handrews
Copy link

@xbmono @VamshiNaidi $merge has been definitively rejected from JSON Schema in json-schema-org/json-schema-spec#515. In its place, the unevaluatedProperties proposal (json-schema-org/json-schema-spec#556) covers the main use case that motivated $merge, while clarifications on how annotations such as title, description and default can be processed covers the next-most-requested behavior (e.g. overriding one title with another when re-using with $ref).

Unless this project intends to diverge from the spec on this point, I would recommend closing this issue.

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

No branches or pull requests

4 participants