-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Avoid setting @ConfigurationProperties property with default value to null when undefined #8512
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
Comments
@sdeleuze I am not following and that sample is rather involved with no readme. What you are describing is kotlin specific I assume (we don't do such thing in Java as far as I know). If that's the case, worth mentioning.... |
True... :) I've added some actual tests to the project now, and added a Readme. |
@sdeleuze we'd probably need you to review the sample and report here again once we've narrow down the issue. This is not Spring Boot specific and I don't know kotlin enough to figure out where the issue is coming from. However, I can explain why this is happening. That sample has a So I am afraid it's a cglib/kotlin incompatiblity and nothing we can fix. Spring Boot doesn't bind to null (you can debug @herder if I exclude the |
@snicoll Ok thanks for your feedback I will have a deeper look. |
Have you had a chance to look further into this, @sdeleuze ? |
Yes I think #8762 will fix your issue when it will be resolved so please follow this issue. |
Uh oh!
There was an error while loading. Please reload this page.
I got an issue reported by @herder with a repro project mentioning that Spring Boot sets the
@ConfigurationProperties
properties tonull
when there is no value defined inapplication.properties
instead of leaving the default value from the constructor.This does not work well with Kotlin non-nullable types and default arguments.
I can help working on a fix.
The text was updated successfully, but these errors were encountered: