-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patch with context (created with ADD_ORIGINAL_VALUE_ON_REPLACE) must fail on value mismatch #91
Comments
|
Sorry I do not understand that. Could you please provide example? |
Try:
Should work as expected. If this is what you mean, |
It looks very well. Thank you very much! And if it is RFC then it indeed better approach then I suggest initially. But I think it it have worth provide context on what path and value apply failed and extends tests on each type where such node may be present. Could you please look at comment https://github.com/flipkart-incubator/zjsonpatch/pull/92/files#r253562286 |
I'm working on that separately (see #94), but in the meantime I also realized we likely have defective generation of |
* Security upgrade (see FasterXML/jackson-databind#2186) * Minor cleanup * Further cleanup * Added DiffFlags.EMIT_TEST_OPERATIONS, along with associated tests and functionality * Further (minor) cleanup * Corrected @SInCE version on EMIT_COPY_OPERATIONS
Thank you very much! |
You have useful
com.flipkart.zjsonpatch.DiffFlags.ADD_ORIGINAL_VALUE_ON_REPLACE
flag on patch creation. But such context fully ignored on apply time!Please look at test:
Now it succeed, but I want mode when it failed with
JsonPatchApplicationException
and message like "Can't apply patch on path [/k2] because it have unexpected value [v3 changed]. Expected value tracked in patch [v2]".I think there should be added corresponding value for that like
com.flipkart.zjsonpatch.CompatibilityFlags#CHECK_ORIGINAL_VALUE
.Are you willing I provide PR for such fix?
The text was updated successfully, but these errors were encountered: