Skip to content
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

Update @ConfigurationProperties Javadoc to mention that the canonical format is required #14258

Closed
mumukiller opened this issue Aug 30, 2018 · 2 comments
Assignees
Labels
type: documentation A documentation update
Milestone

Comments

@mumukiller
Copy link

Reproduced for me using 2.0.3.RELEASE

I found similar issue here - #9545
As mentioned it should be fixed in 2.0.3.M3 but looks like it's not

My case is similar but without explicit prefix parameter

@Getter
@Setter
@ConfigurationProperties("myCommonProperties")
public class MyCommonProperties {
  private String someProperty;
}

It fails with

Caused by: org.springframework.boot.context.properties.source.InvalidConfigurationPropertyNameException: Configuration property name 'myCommonProperties' is not valid

Haven't found any other opened issues with similar behaviour

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 30, 2018
@mumukiller mumukiller changed the title @ConfigurationProperties fails with capital letters @ConfigurationProperties fails if its value contain capital letters Aug 30, 2018
@mumukiller mumukiller changed the title @ConfigurationProperties fails if its value contain capital letters @ConfigurationProperties fails if its value contains capital letters Aug 30, 2018
@snicoll
Copy link
Member

snicoll commented Aug 30, 2018

You've deleted your comment on #9545 but just above it there is this comment.

The prefix for @ConfigurationProperties must use the canonical format (i.e. @ConfigurationProperties("my-common-properties"). Let's reuse this issue to also update the Javadoc of @ConfigurationProperties.

I guess you got that exception in a test. If you start the app there is a FailureAnalyzer that explains you what the problem was (that's what #9545 actually added).

@snicoll snicoll changed the title @ConfigurationProperties fails if its value contains capital letters Update @ConfigurationProperties Javadoc to mention that the canonical format is required Aug 30, 2018
@snicoll snicoll added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 30, 2018
@snicoll snicoll added this to the 2.0.x milestone Aug 30, 2018
@mumukiller
Copy link
Author

Yup! It would be great to have this mentioned in the documentation.

@snicoll snicoll self-assigned this Aug 31, 2018
@snicoll snicoll modified the milestones: 2.0.x, 2.0.5 Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

No branches or pull requests

3 participants