-
Notifications
You must be signed in to change notification settings - Fork 1k
Spring config type safe coercion #15784
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
Spring config type safe coercion #15784
Conversation
| .isEqualTo("string_value"); | ||
|
|
||
| assertThat(config.getBoolean("bool_key")).isTrue(); | ||
| assertThat(config.getBoolean("bool_key_with_env")).isNull(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with otel declarative config this would be isTrue(), I think it will be confusing if that doesn't work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that's possible - neither PR is perfect in terms of UX.
I think we have to start with one and see how user like it.
- From my own experience, the spring style override is more common, which still works
- non-string properties are also quite rare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the spring style override
what is the spring style override?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I'm coming around to doing the runtime coercion for spring that you originally proposed...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK - feel free to merge 😄
Alternative for #15775 that limits type ceorcion to environment variables.