DataWeave Tip #6: Empty JSON Object

#ICYDK: During the transformation to JSON, I do not often want null properties. It is easy to remove them by just using skipNullOn attribute. However, for empty objects, it is not that trivial, especially when you have to deal with many such cases within one transformation. In this article, I will show you how you can achieve this quick and easy.

Contract

Below you can see what we have as an input and what we expect. In our example we have complex.embedded.obj empty and contents’ array with two empty objects. I would like to to easily remove them from the output. https://goo.gl/aHPGgN #DataIntegration #ML

Subscribe To Newsletter

Sign up for my newsletter and get the latest technology news

2019 © Craig Brown PhD. All rights reserved.