Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

additionalProperties, nullable and minItems introduced#31

Open
tg44 wants to merge 3 commits intoaspecto-io:masterfrom
tg44:master
Open

additionalProperties, nullable and minItems introduced#31
tg44 wants to merge 3 commits intoaspecto-io:masterfrom
tg44:master

Conversation

@tg44
Copy link

@tg44 tg44 commented Apr 16, 2023

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant