Idea ID 2844334
Today, when I build a REST driver I have to handle all the XDS > JSON and JSON > XDS transformations in ECMAScript. There is some default ECMAScript that is supplied, but it doesn't fit most REST implementations. Most of the driver is so configurable, but this part requires some serious ECMAScript parsing talent. I noticed in IDM 4.8 there is the addition of 2 new DirXML Script nouns:
- Json Object
- Json Array
These would seem to work for constructing a JSON object if I was able to supply all object properties at once, and constructing an array similarly. In reality, the XDS document coming into my policy may take many forms. I will more than likely need to iterate in some kind of for-each loop to build an object and append key-value pairs. A verb like "Set JSON Property" would be nice, and it would be nice to be able to supply it with different types: string, number, array, nested JSON object. Similarly, I may not know all the values of a JSON array at once, so it would be nice to be able to append an item to an array (i.e. push()), and remove an item from an array by value (i.e. combination of indexOf() and splice()).
It might also be nice to have a "Get JSON Property" that uses something like JSONPath to grab a property from 1 or many levels deep. This would be most helpful on the input transform to build proper status docs and parse the status codes/messages as well as pull association values from successful adds or matches.
Again, this is solvable today with ECMAScript, but it would be nice to be able to do it natively.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.