-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Empty YAML array does not override property from source with lower precedence #12965
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
Thanks for the report. I think this is a bug in Spring Framework's test:
empty:
strKey:
listKey: I've opened SPR-16769. If the Framework team agree with my assessment, we'll pick up a fix in due course. In the meantime, please use the alternative described above. |
@wilkinsona - Thanks for the quick response and advice. However I can not use empty values because there are validation for property value in my project for cron sequence and the property is array of nested objects in actual
please let me know if I can use other alternative in this case |
I can't think of a way for this to work where the list is of objects rather than scalars. I also don't think the likely fix for SPR-16769 will help.
I can't see how that can be the case with a list of objects that you're actually trying to use. I'll re-open this issue so that we can investigate further, but we'll only be able to do so if you can provide a sample that demonstrates the actual problem that you're trying to solve. Note that there's no need to involve a remote config server, you can use local configuration files and local profile-specific configuration files instead. The profile-specific file should override in that case. |
sorry for confusion, my statement-
was for the very first example in this thread where I'm trying to show the sample situation with scalers and I will use your advise to solve issue with scalers.(refer below example)
but the main issue is when I deal with nested Objects.. (refer below example). which I'm still unable to solve with yml. (I haven't tried .properties for this and will not able to do that as well)
|
Thanks for the clarification, @gautamceg. That means that SPR-16769 alone won't be enough to fix this problem. I believe that @snicoll only plans to fix the Framework issue in 5.0.x so we'll only be able to tackle this in Boot 2.0.x at the earliest. |
As things stand, I'm not sure what we can do to fix this. When using I've labelled this for team attention to see if the rest of the team think we should be trying to fix this, and if so, to get some suggestions on what the best approach may be. |
I think being able to replace a higher level value with an empty list is pretty important. At least of the binder support we should try to support that. |
SpringBoot version - 1.5.10.RELEASE
I'm using Spring Centralized Configuration to store my application configuration and it works fine for single valued properties but for MultiValued properties remote config is not able to override local properties.
remote config file: test-cloud-config.yml
SpringBoot resource local: application.yml
My spring boot class:-
Output
but I expect 'testEmptyListKey' to be empty.
The text was updated successfully, but these errors were encountered: