-
Notifications
You must be signed in to change notification settings - Fork 40.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BindableRuntimeHintsRegistrar does not generate hints for all nested types of a ConfigurationProperties type #36909
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@snicoll I reviewed class ConfigurationPropertiesBeanFactoryInitializationAotProcessor. And I understood what you said. Thank you. But then isn't the document wrong? The Spring documentation says: . Nested configuration properties which are not inner classes, however, must be annotated with @NestedConfigurationProperty, otherwise they won't be detected and will not be bindable. (@ConfigurationProperties) But with the update you made, nested configurations are automatically registered. If what I think is true, should I open an issue to update the document? Or should I discuss it in gitter? |
The documentation states the exact same thing. Those are inner classes don’t they? |
@snicoll I understand that thanks to your development, nested configuration properties which are not inner classes will be registered automatically.((@ConfigurationProperties)) Thanks to your development, we will not need to add the @NestedConfigurationProperty annotation. However, the documentation says "nested configuration properties which are not inner classes cannot be detected , so you must add the @NestedConfigurationProperty annotation for nested configuration properties which are not inner classes.." Please excuse me for keeping you busy. I reviewed your test. Let's say we update your test in your commit as in the example below. Then, would these classes(Simple, ListenerRetry, Retry) be registered to hint automatically? (Without @NestedConfigurationProperty annotation)
Which of the following did your commit solve for automatic registration to hint? I want to understand this situation. |
We still need to figure it out but it looks like the nested class detection can be faulty. This can be reproduced by running
BindableRuntimeHintsRegistrar
againstRabbitProperties
, there is no metadata fororg.springframework.boot.autoconfigure.amqp.RabbitProperties$SimpleContainer
.The text was updated successfully, but these errors were encountered: