How does one configure spring configuration metadata json for nested list of objects?
@ConfigurationProperties(prefix = "custom-config")
public class ConfigProperties {
private boolean booleanProperty;
private List<NestedObject> listProperty = new LinkedList<>();
//getters and setters
}
public class NestedObject {
private String stringProperty;
private boolean booleanProperty;
//getters and setters
}
This is what was auto generated in the metadata json
{
"groups": [{
"name": "custom-config",
"type": "testing.config.properties.ConfigProperties",
"sourceType": "testing.config.properties.ConfigProperties"
}],
"properties": [
{
"name": "custom-config.boolean-property",
"type": "java.lang.Boolean",
"sourceType": "testing.config.properties.ConfigProperties",
"defaultValue": false
},
{
"name": "custom-config.list-property",
"type": "java.util.List<testing.config.properties.NestedObject>",
"sourceType": "testing.config.properties.ConfigProperties"
}
],
"hints": []
}
How do I configure the child properties either in java code or in json?
As seen below, the editor doesn't recognise the child properties.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With