Skip to content

Example JSON Patch of replace EReference operation #200

Discussion options

You must be logged in to vote

Hi,

A replace operation is equivalent to a remove, followed by an add. It seems that the remove works fine (As shown by the result), but the add fails. This could be caused in some cases, where the value is incorrectly specified (So the value is set to null instead of throwing an exception or setting the correct value).

You can try the following, to make sure the object URI is properly resolved:

{
       "op":"replace",
       "path":"#//@transitions.0/input",
       "value": {
           "$ref" : "#//@inputs.1"
       }
}

EMF-like paths should include the fragment symbol (#) to distinguish them from Json Pointers, otherwise the Invalid Object Property error will be thrown.

You can also t…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Yunabell-VU
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Yunabell-VU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants