Forum Discussion
Have you ever found a good solution to this besides converting it to a string prior?
Generally, the proposed method by @jaybodra works, but it seems more like a short-term workaround.
Additionally, I’m unable to retain the sorting of the dumps after re-loading it, even when telling it to do so specifically. So this only leaves the option of entering a string and passing out a string and then using JSON.parse(), then it will actually be an ordered json … 😮
json_input = json.loads(inDoc.get('content'))
json_string = json.dumps(json_input, sort_keys=True)
json_output = json.loads(json_string, object_pairs_hook=OrderedDict)
Best regards
Thomas
- Senthilnaga913 years agoNew Contributor III
Can you pls share your pipeline design to have more clarity ?
Related Content
- 10 days ago
- 8 years ago