Description
Even when #3783 is resolved, it feels that we could make the following scenario easier.
Assume you need a reference to some service so you create a property of your own app.foo.url
or something. That service is also supported by your favorite cloud provider and it injects a vcap.services.foo.credentials.uri
property with the value to use for that particular app. You only want to deal with app.foo.url
and ideally you'd like the cloud provided value to override any value provided by configuration (And I imagine for other cases you'd want the reverse).
To achieve this behaviour today, you may annotate the field with @Value
and the name of the "cloud" property. Which means you need to hardcode the name of the service somehow.
It would be nice if we could extend the concept of alias so that a particular property may be overridden with an arbitrary number of keys.
Added bonus: sometimes the key provided by the cloud provider has a different structure so you may want a callback to extract the bits that you need.
See this example for a concrete use case.