davidradl commented on PR #36: URL: https://github.com/apache/flink-connector-http/pull/36#issuecomment-4090226526
@seb-pereira @ferenc-csaky I am looking to be able to replace sections of the payload with literals. I want to be able to specify a json path and a value that will be put at that path. The path can be an object, array or literal. As such the existing design does not handle this because an object "/obj1/str1" = "aaa" could mean we want to replace str1 with "aaa" or to replace "obj1" with str1="aaa" In order to be able to handle these cases, we looked for standard practise and found [JSON patch](https://jsonpatch.com/). Which allows " The original document { "baz": "qux", "foo": "bar" } The patch [ { "op": "replace", "path": "/baz", "value": "boo" }, { "op": "add", "path": "/hello", "value": ["world"] }, { "op": "remove", "path": "/foo" } ] " This is useful but if the field is in an object that does not exist in the event stream, then we want to force the literal in, [Stratgic merge](https://www.linkedin.com/pulse/patches-kustomize-json-6902-vs-strategic-merge-patch-adamson-hwngc/) allows this. But is a merge. We are wanting a Strategic replace, so it forces the literal value into the path, whether or not there is a parent object. Inspired by these approaches; we are looking at a payload of : ``` [ { "path": "/baz", "value": "boo" }, ... ] ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
