Skip to content

Make it easier to bind alias from the environment #5113

Closed
@snicoll

Description

@snicoll

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently apply

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions