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
Expected behavior: An error is thrown (something like "Invalid JSON Patch").
Actual observed behavior: No error is thrown (just like if patch was an empty Array).
In the applyPatch implementation, we can see that if patch is an object like {} instead of an Array of valid JSON Patch operations, it will get "applied" successfully (because patch.length will be undefined, and the for-loop won't run).
Maybe it should throw if validateOperation is true?
The text was updated successfully, but these errors were encountered:
Steps to reproduce:
patch
was an empty Array).In the applyPatch implementation, we can see that if
patch
is an object like{}
instead of an Array of valid JSON Patch operations, it will get "applied" successfully (becausepatch.length
will beundefined
, and the for-loop won't run).Maybe it should throw if
validateOperation
istrue
?The text was updated successfully, but these errors were encountered: