Skip to content

Conversation

@Tomkowski
Copy link

Current solution does not allow nesting keys in variable expansion for the @Key annnotation.
Let us assume the following scenario:

    @Key("environment")
    @DefaultValue("global")
    String env();

    @Key("environments.${environment}.webdriver.url")
    String webDriverUrl();

    @Key("environments.${environment}.browser")
    @DefaultValue("chrome")
    String usedBrowser();

I want to have a property based on the selected browser property which is already based on the selected environment property. I am trying to access the property in the following ways:

    @Key("environments.${environment}.webdriver.${usedBrowser}.switches")
    String webDriverOptions();
    @Key("environments.${environment}.webdriver.${environments.${environment}.browser}.switches")
    String webDriverOptions();

but neither solution is working.
This pull request adds ability to nest variable expansion inside @Key annotiation.

@Tomkowski Tomkowski marked this pull request as ready for review December 4, 2022 20:25
@Tomkowski
Copy link
Author

Interestingly enough, my solution also enables properties to have curly brackets in its name. E.g.: {name} is now a valid property name. I am not sure whether it is a real case scenario or just some corner case.

@Tomkowski Tomkowski marked this pull request as draft December 6, 2022 07:32
@Tomkowski Tomkowski marked this pull request as ready for review December 11, 2022 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant