Because different discriminator values can have different schemas, our current strategy of applying basic JSON merge-patch fails when users change the discriminator and (therefore the schema).
Ex:
ex. target:
{
...
limit: {
method: 'row_count',
threshold: 1000
}
...
}
PATCH:
{
...
limit: {
method: 'percentile',
percentile: 80
}
...
}
AJV complains that percentile isn't valid because it's seeing both threshold and percentile when applying naive json merge-patch.
Per @emk - The basic fix here is for all MergePatch types to start allowing additionalProperties: { type: null }.
Then this would work, for ex:
PATCH ...
{
...
limit: {
method: 'percentile',
percentile: 80,
threshold: null
}
...
}