This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
additionalProperties, nullable and minItems introduced #31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hy!
This got lot bigger than I expected... And it is not fully consistent, but working.
Merging schemas should go two directions. There is a use-case when I have a lot of things, and I want to find the most suitable schema to them. For this, I want to restrict the merge. So if I have a field in one schema that is nullable, and the same field in on other schema is non-nullable, I want to make the merged field non-nullable. But there is an other use-case, when I want to find out if a schema is a subschema of an another or not. In this case I want to merge permissive, so merging a non-nullable with a nullable schould be nullable. I found out this fundamentally easy thing at the end of my last test-case, and I didn't have time to properly refactor the whole thing, so I committed this as-is bcs it is working already, and covers a LOT more functionality than the prev code, and I think it is a good starting point.
I think the test are describing what works and how. I think in most cases this will be the intended behavior.
I'm open for further discussions and cleanups.