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
A value that is null, an array, or a scalar cannot have an object patched. This should result in an error and a non-zero exit code. Currently the tool returns a 0 exit code and the unaffected input.
This ticket should also capture any additional ways that the patch command fails silently that we are aware of.
These are bugs and not breaking changes. Any existing users that "rely" on this broken behavior have the opportunity to resolve the incorrect usage of the tool because of the new raised failure.
The text was updated successfully, but these errors were encountered:
Repeating what I wrote in the linked issue, but more on topic here;
I do not think that is helpful in this case; The patch operations explicitly defined the patch to be on an array or an object. So the user clearly expresses their intent to patch only those types. So it is safe to ignore other values. Consider the following json:
Currently a recursive patch for all "tags" objects, setting field; "hello": "universe", will work as intended. Since it will skip $.filter_by.tags since it is a boolean.
If we throw a hard error on this then for a user to work around this would be quite cumbersome I think. Especially because of the dynamic data we're dealing with. Any custom plugin can introduce a field that has a name collision with an existing Kong field.
How about adding a flag to make it configurable such that cases like this will still work?
eg. --fail-on-non-matching-type (or preferably something shorter), and print a warning otherwise.
This feels like an assumption. It's not obvious why the patch shouldn't work in this case, the user has to know we skip because of a type check that may or may not be useful to them.
The selector provided by the user should scope the targets of the patch such that only the intended values are updated
Examples
Assume
in.yaml
:A value that is
null
, an array, or a scalar cannot have an object patched. This should result in an error and a non-zero exit code. Currently the tool returns a 0 exit code and the unaffected input.This ticket should also capture any additional ways that the patch command fails silently that we are aware of.
These are bugs and not breaking changes. Any existing users that "rely" on this broken behavior have the opportunity to resolve the incorrect usage of the tool because of the new raised failure.
The text was updated successfully, but these errors were encountered: