Open
Description
Most JsonProviders omit writing their field(s) if their value is null (absent). This is however not the case for the NestedJsonProvider. Consider the following configuration:
<providers>
<nestedField>
<fieldName>nested</fieldName>
<providers>
<mdc/>
</providers>
</nestedField>
</providers>
This configuration produces a JSON similar to the following:
{
"nested": {
"mdc1": "value1",
"mdc2": "value2"
}
}
However when not MDC keys are present or if none matches the include pattern of the MDC json provider, the "nested" object becomes empty and the output looks as follows:
{
"nested": {
}
}
There is unfortunately no option to omit the nested object when it is empty similar to what is available to the PatternJsonProvider.