private static void normalizeClosureDescriptions(CompositeTemplate entity, boolean serialize) { if (!serialize) { return; } for (Entry<String, ComponentTemplate<ClosureDescription>> entry : filterComponentTemplates( entity.components, ClosureDescription.class).entrySet()) { ComponentTemplate<ClosureDescription> component = entry.getValue(); CustomClosureDescription newData = new CustomClosureDescription(); PropertyUtils.mergeServiceDocuments(newData, component.data); if (newData.inputs != null) { newData.serializedInputs = new HashMap<>(); newData.inputs.entrySet().forEach((e -> { newData.serializedInputs.put(e.getKey(), e.getValue().toString()); })); newData.inputs = null; } if (newData.logConfiguration != null) { newData.serializedLogConfiguration = jsonToMap(newData.logConfiguration); newData.logConfiguration = null; } component.data = newData; } }