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

Merging examples #22

Open
ottomata opened this issue Jun 26, 2020 · 0 comments
Open

Merging examples #22

ottomata opened this issue Jun 26, 2020 · 0 comments

Comments

@ottomata
Copy link

Hiya, I'm not sure if this should be in json-schema-merge-allof or just left up to me to write a custom resolver.

When merging JSONSchemas, I think we can assume that any examples of each of the to-be-merged schemas should also be merged. Since JSONSchema examples is an array, we need to merge each corresponding examples array element in each of the to-be-merged schemas. When encountering arrays, the default behavior seems to be to concatenate them, but examples should have each element merged.

I wrote a custom resolver for examples here: https://github.com/wikimedia/jsonschema-tools/pull/14/files
but I could alternatively submit a PR to make this the default behavior for examples if that would make sense to you.

Feel free to decline this issue if you'd rather not change the behavior.

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

1 participant