-
Bug Report
-
Resolution: Unresolved
-
L3 - Default
-
None
-
None
-
None
When making a JSON path query and resolving it to a SpinJsonNode (e.g. SpinJsonNode jsonPathNode = spinJsonNode.jsonPath("$[0]").element()), the #element invocation does not return a SpinJsonNode that references the actual JsonNode in the original spinJsonNode variable, but it references a copy of that. In consequence, chaning properties of jsonPathNode is not going to be reflected in spinJsonNode.
This is not consistent with the other traversal APIs (e.g. SpinJsonNode directAccessNode = spinJsonNode.elements().get(0)) where changes to directAccessNode will be reflected in spinJsonNode. This inconsistency is currently not documented.
Solution possibilities:
- document this difference in behavior for the json path API
- fix the json path API such that the behavior is consistent (see https://github.com/jayway/JsonPath/issues/160)
Forum post: https://forum.camunda.org/t/is-it-possible-to-manipulate-a-json-object-with-the-spin-api/1337
This ticket was migrated to github: https://github.com/camunda/camunda-bpm-platform/issues/2236. Please use this link for any future references and continue any discussion there.