How does one configure spring configuration metadata json for nested list of objects?
@ConfigurationProperties(prefix = \"custom-config\")
pub
To your question: "How do I configure the child properties either in java code or in json?"
Long Answer:
See https://github.com/spring-projects/spring-boot/wiki/IDE-binding-features#simple-pojo
In particular, look at the sections "Simple Pojo" and "Wrapping Up".
Short Answer:
You've done all you can. The IDE has all the information it needs. The properties of NestedObject
can be determined via reflection based on the information given on line 16 of your output:
"type": "java.util.List"
The IDE is given the class that the list is capable of accepting. The IDE should use the class name to infer the available properties on NestedObject
. However, as of this writing, not all IDEs fully reflect into the nested class for both properties and YAML formats.
It seems that IntelliJ reflects into the value type for lists in properties files, but it doesn't reflect into map value types. It doesn't reflect at all into list or map values for YAML files. I'm not sure about Spring Tool Suite, but last time I checked, its support for auto-completion was missing these features as well.
If you're an IntelliJ user, I recommend voting on these two issues so that full support for collection types will be supported: