You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IDE configuration metadata does not respect @Name annotation for property binding #1751
When using Spring Boot configuration properties that rely on the @Name annotation, the IDE (STS) appears to generate or interpret configuration metadata based solely on naming conventions, ignoring the explicit name defined by @Name.
This leads to incorrect property suggestions and misleading configuration guidance in the IDE.
Environment
Spring Tools for Eclipse 5.0.0.RELEASE
Spring Boot version: 4.0.1
Problem Description
In Spring Boot 4.0.1, the following configuration properties class exists:
This suggests that the IDE is deriving the property name from the field name (defaultVersion) instead of honoring the explicit @Name("default") annotation.
Actual Behavior
IDE auto-completion and metadata suggest default-version
Using default-version has no effect at runtime
No warning or error is shown in the IDE
Expected Behavior
The IDE should:
Respect the @Name annotation when generating or interpreting configuration metadata
I've closed the duplicate. This arrangement is a bit unusual and I don't think we had that case before.
In short, when you discover a POJO that's the target of a map or a list, the same rules should apply to the pojo. With a regular object, you don't have to worry about those as the metadata is correctly generated for you. However, this isn't the case at the moment for maps.
I suppose that if you link a property to where it's defined, you'd have to handle @Name in any case. Let me know if I can help.
@snicoll
Thanks for the clarification, that makes sense.
I’ve attached a screenshot to better illustrate the current behavior.
In the IDE, the default property (which is the one that actually binds at runtime) is marked as invalid, while default-version shows no error.
However, in practice, only default works correctly and default-version is ignored.
This made me wonder about the original intention behind using @Name("default") here.
Was there a specific reason why the property couldn’t simply be exposed as default-version?
Or is there another recommended way to avoid this mismatch between runtime binding and IDE metadata/validation?
I just wanted to better understand the design choice and whether there is an alternative approach to address this from a user perspective.
Activity
martinlippert commentedon Dec 24, 2025
Related issue: spring-projects/spring-boot#48611
snicoll commentedon Dec 24, 2025
I've closed the duplicate. This arrangement is a bit unusual and I don't think we had that case before.
In short, when you discover a POJO that's the target of a map or a list, the same rules should apply to the pojo. With a regular object, you don't have to worry about those as the metadata is correctly generated for you. However, this isn't the case at the moment for maps.
I suppose that if you link a property to where it's defined, you'd have to handle
@Namein any case. Let me know if I can help.libedi commentedon Dec 25, 2025
@snicoll
Thanks for the clarification, that makes sense.
I’ve attached a screenshot to better illustrate the current behavior.
In the IDE, the
defaultproperty (which is the one that actually binds at runtime) is marked as invalid, whiledefault-versionshows no error.However, in practice, only
defaultworks correctly anddefault-versionis ignored.This made me wonder about the original intention behind using
@Name("default")here.Was there a specific reason why the property couldn’t simply be exposed as
default-version?Or is there another recommended way to avoid this mismatch between runtime binding and IDE metadata/validation?
I just wanted to better understand the design choice and whether there is an alternative approach to address this from a user perspective.