Here's a simple use case:
@ConfigurationPropertiesSource
public class BaseType {
/**
* Name to use.
*/
private String name = "test";
private final Inner inner = new Inner();
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public Inner getInner() {
return this.inner;
}
public static class Inner {
/**
* Some smart description
*/
private int counter = 42;
public int getCounter() {
return this.counter;
}
public void setCounter(int counter) {
this.counter = counter;
}
}
}
If we extend in another module from BaseType, something like
@ConfigurationProperties("example")
public class ExampleType extends BaseType { ...}
Then the inner properties are not documented. To make this work, we need to annotate Inner with @ConfigurationPropertiesSource as well. That's a bit confusing as we do this automatically for configuration properties.
When fixing this, there are a number of classes that should be updated, for instance org.springframework.boot.http.client.autoconfigure.reactive.AbstractClientHttpConnectorProperties.
Comment From: iamjeonghun
Hi, I'd like to work on this enhancement. Could you please confirm the expected approach before I get started?
Comment From: snicoll
@iamjeonghun thanks for the offer. If you're not versed with that part of the code base, I am afraid it isn't a great issue for a first time contributor. I don't really know yet how to fix it and I'll have to dig in a bit.