Closed vman049 closed 1 year ago
I don't have a good answer for this beyond what the error message says.
In the future I might look into implementing arrayMergeById for schemas where "items" is an array, but I can't make any promises.
Thanks, @avian2. I'm just wondering -- how is what I did different from what is in the test case (example 6 here)? My understanding is that the only difference is that I added additional information about the schema than what is in the case. But otherwise, the case is the same. So if it works in the provided test case, it should also work for my schema. Am I missing something?
arrayMergeById needs to look down into items
to figure out where in the schema to descend into. It needs this to find the merge strategy to use when merging individual array items (and possibly further objects, arrays, etc. down the hierarchy). The logic to do this when items
is an array is not implemented, so it just throws an error when it sees an array.
In your example, it doesn't need to look into items
because there is nothing useful further defined there, but in general that is not the case.
I see. It looks like it's an issue with the example itself since it's not using the the function as intended and causes the function to break when the complete schema is provided. Thanks for your response.
In example 6 here, when providing the full schema obtained here as shown below:
the command
base = merger.merge(base, a)
breaks with the error:The expected result is for
base
to equala
after the merge.