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

Add @ConfigMapping beanStyleGetter to enable / disable bean style getter names matching with configuration names #1239

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

radcortez
Copy link
Member

* <p>
* Config mapping declarations should prefer to use simple names that match one-to-one with their configuration
* names. Bean-style getter matching allows multiple method names to match the same configuration name. For
* instance, <code>getFoo</code> and <code>isFoo</code> both match <code>foo</code>, which may not be intended.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know which one Kotlin uses? Maybe we should have this be an enum with each possiblity?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can tell is get, but you can override the name in Kotlin.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmlloyd are you ok to merge as is? Or do you prefer something different?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a thought to differentiate between these two cases, but I think it probably doesn't matter too much.

* <p>
* Config mapping declarations should prefer to use simple names that match one-to-one with their configuration
* names. Bean-style getter matching allows multiple method names to match the same configuration name. For
* instance, <code>getFoo</code> and <code>isFoo</code> both match <code>foo</code>, which may not be intended.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a thought to differentiate between these two cases, but I think it probably doesn't matter too much.

@radcortez radcortez merged commit bedbff5 into smallrye:main Oct 15, 2024
8 checks passed
@github-actions github-actions bot added this to the 3.10.0 milestone Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Are getters supported?
2 participants