Hi Everyone,
I am currently writing EPL script that listens for measurements and, for each of this measurements, it sends POST request to a microservice deployed on Cumulocity. The problem is that some of the properties inside payload have to be in specific order.
Example of proper payload:
The JSON standard describes an object as āā¦ an unordered set of name/value pairs.ā (see: JSON) So an implementation that relies on this order is inherently non-standard. Iād recommend rethinking this design.
If this microservice you are sending this data to is under your control, my first thought would be to make it independent of such non-standard JSON parsing requirements.
More specifically, there is also no way in EPL to enforce the order of elements here.
In general, I suggest following Philipps suggestion to make the microservice not rely on the order. If the order is important you could use an array instead of an object as arrays have an order. You would still need to change the microservice though.