@ConfigurationProperties bean name describe of "com.example.app-com.example.app.SomeProperties". I didn't find where the prefix of SomeProperties is declared (com.example.app). Is there a problem here?
https://docs.spring.io/spring-boot/docs/3.0.0/reference/htmlsingle/#features.external-config.typesafe-configuration-properties.enabling-annotated-types
Comment From: scottfrederick
The documentation states:
... the bean has a conventional name:
<prefix>-<fqn>, where<prefix>is the environment key prefix specified in the@ConfigurationPropertiesannotation and<fqn>is the fully qualified name of the bean. If the annotation does not provide any prefix, only the fully qualified name of the bean is used.
In this example, the prefix is shown just above the note with @ConfigurationPropertiesScan({ "com.example.app", "com.example.another" }), and the FQN of the implementing class is com.example.app.SomeProperties.
The term bean is used several times in the quoted paragraph to refer to different things. This could be clarified by referring to the implementing class using class instead of bean, as in:
... the bean has a conventional name:
<prefix>-<fqn>, where<prefix>is the environment key prefix specified in the@ConfigurationPropertiesannotation and<fqn>is the fully qualified name of the configuration properties class. If the annotation does not provide any prefix, only the fully qualified name of the configuration properties class is used.
Comment From: dfjfj
Sorry, you may have misunderstood me. The bean name that com.example.app-com.example.app.SomeProperties should have a annotation @ConfigurationProperties(prefix="com.example.app") on com.example.app.SomeProperties, but I didn't find where the prefix is specified in the document.
Comment From: scottfrederick
You're right. I was looking at the @ConfigurationPropertiesScan({ "com.example.app", "com.example.another" }) annotation shown in the example. The values provided there are base packages to scan, not environment key prefixes, so the com.example.app-com.example.app.SomeProperties doesn't make sense in this context. We should clarify that in this section along with the edits suggested above.
Thanks for pointing this out.
Comment From: dfjfj
thank you very much.
Comment From: wilkinsona
Closing in favor of #34029.