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
Clearly document the limitations of @Value with respect to relaxed binding #4413
Comments
Are you aware that we are already supporting this with |
Hmm I think at least some of the relaxed binding properties work for |
Yes, there are some basic relaxed binding in the core framework as well. Advanced relaxed binding is a spring boot feature and is quite opinionated so it does not belong in the core framework IMO. WDYT @dsyer @wilkinsona ? |
Ah I see. Perhaps the documentation can be even more clear that the same rules/properties does not apply to the |
I've just built a small example with
On a second though and checking the core framework again we don't have any such transformation of the key. I am busy documenting the differences between |
Suppose I have a property like this:
It's hard to make Spring map hyphens like
with-dash
from an environment variable. Let's say I've built my spring onejar then I can't just provide an environment variable like this (bash):You need to use a work-around like this:
$ env 'SOMETHING_WITH-DASH=Something' java -jar my-spring-onejar.jar
But in certain frameworks such as Kubernetes you cannot use a hyphen in environment variables since they use the C_IDENTIFIER format as the lowest common denominator. I've aded an issue for this in Kubernetes but I'm not sure if they're willing to change it.
So I wonder if instead Spring could enhance its way that hyphens are treated in environment variables when matching the
@Value
annotation? For example ifSOMETHING_WITH_DASH
could map tosomething.with-dash
?The text was updated successfully, but these errors were encountered: