You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but in my case, I trying to write a general system where the array key isn't necessarily a top-level key named "a"; I want to merge any and all arrays using "append" instead of "overwrite".
Is this possible somehow? Ideally I would be able to set schema like so: (this obviously does not currently work)
This seems to work correctly for validation with current jsonschema (even though self-referential schemas are technically undefined behavior). Unfortunately, oneOfkeyword is not currently supported at all in jsonmerge, so this does not work for merging right now.
I'll look into implementing a basic support for oneOf that will work with the schema above. It should be relatively straightforward compared to anyOf and allOf.
For a quick-and-dirty fix, modify the WalkInstance.default_strategy method. I don't think you can achieve what you want with a custom merge strategy.
I want the following assertion to pass:
I know that this is possible with
but in my case, I trying to write a general system where the array key isn't necessarily a top-level key named "a"; I want to merge any and all arrays using
"append"
instead of"overwrite"
.Is this possible somehow? Ideally I would be able to set
schema
like so: (this obviously does not currently work)It seems like the best route would be to create a custom merge strategy, but I'm hoping there's an easier solution that I've overlooked
The text was updated successfully, but these errors were encountered: