Skip to content
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

Type Map<String,String> in config root is not working #1415

Closed
starksm64 opened this issue Mar 12, 2019 · 4 comments
Closed

Type Map<String,String> in config root is not working #1415

starksm64 opened this issue Mar 12, 2019 · 4 comments
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@starksm64
Copy link
Contributor

If I have a Map<String,String> in a config object such as:

@ConfigRoot(name = "rt", phase = ConfigPhase.RUN_TIME)
public class TestRunTimeConfig {
    /** A map of properties */
    @ConfigItem
    public Map<String, String> stringMap;
...

With an application.properties configuration like:

# A root map of properties
quarkus.rt.string-map.key1=value1
quarkus.rt.string-map.key2=value2
quarkus.rt.string-map.key3=value3

The are no values populated into the stringMap.

@starksm64 starksm64 added the kind/bug Something isn't working label Mar 12, 2019
@starksm64
Copy link
Contributor Author

What currently happens is that processing goes into this ConfigDefintion#processMap(...) code block:

        } else {
            // treat as a plain object, hope for the best
            // TODO, REVISIT THIS
            final ObjectConfigType leaf = new ObjectConfigType(NO_CONTAINING_NAME, mct, true, "", valueClass);
            //container.getConfigDefinition().getLeafPatterns().addPattern(subKey, leaf);
        }

and no leaf node ends up handling the configuration value.

@starksm64 starksm64 self-assigned this Mar 12, 2019
@starksm64
Copy link
Contributor Author

I think I have a straightforward fix for this

@starksm64
Copy link
Contributor Author

It got a little more complicated when I got to the bytecode generation to load the config into runtime. Let me know if there are changes.

dmlloyd added a commit to dmlloyd/quarkus that referenced this issue Mar 12, 2019
Fixes quarkusio#1415, closes quarkusio#1423


Co-authored-by: Scott M Stark <starksm@starkinternational.com>
@dmlloyd
Copy link
Member

dmlloyd commented Mar 12, 2019

I incorporated some of these changes and the tests into #1430. If that one looks/works OK, merging it will auto-close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants