I’m trying to make use of the JSONUpdater transformer since it seems more clear than doing a search & replace. My issue is I just can’t understand the JSONiq enough to know what I need to do to always find the right JSON Path.
I’m reading in a JSON template and in this template are 3 objects at json[“flowcontents”][“processors”]. The problem is the order can change for the processors. I might want 0, 1, or 2. The key is the object # I want always has “name : Build-Parameters”.
I’m thinking I have two options.
- Is there a way with JSONiq to always specify the correct JSON Path in the JSONUpdater, based on the name of each object.
- Maybe I sort the processors objects in the JSON prior to the JSONUpdater transformer. Then I always specify the correct one to find path. (Thankfully the order doesn’t matter when I push the results back.)
I went ahead and made a very simple Workbench which demonstrates my JSON and the problem.
Could someone help with either solution or maybe something else I didn’t think about?