Skip to content

NestedJsonProvider: fieldName must be *mandatory* but isn't #783

Open
@brenuart

Description

@brenuart

The *NestedJsonProvider providers allow to nest other providers within a sub-object whose name is given by the fieldName configuration property. Although the fieldName is mandatory, the provider doesn't check if a non-null and non-empty value is specified when started.

The field name is initialised to nested by default but another value can be set via the setFieldName(String) setter.
Note that because of the way it works, the Logback XML configuration mechanism will never attempt to call this method with a null or an empty string. In this context the fieldName is therefore always guaranteed to be set to a "valid" value. However this may not be the case when Logback is configured programmatically instead of through an XML file.

Conclusion: the AbstractNestedJsonProvider should ideally validate the fieldName property when started and throw an exception if it is null or empty.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions