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

Non-optimal behavior for collection-based configuration keys #84

Closed
dmlloyd opened this issue Feb 13, 2019 · 2 comments · Fixed by #102
Closed

Non-optimal behavior for collection-based configuration keys #84

dmlloyd opened this issue Feb 13, 2019 · 2 comments · Fixed by #102

Comments

@dmlloyd
Copy link
Contributor

dmlloyd commented Feb 13, 2019

Both the standard List injection and our own io.smallrye.config.SmallRyeConfig#getValues use the same mechanism to expand a list of items. However neither one has any special handling for empty values so chances are things like this will fail:

// config contains: test.key=1,2,,4,5
config.getValues("test.key", Integer.class, ArrayList::new);

The problem is that if we start supporting property expansion, this kind of thing becomes possible when you have an input string like: 1,2,${maybe.three?},4,5.

I propose that we treat empty list items as not present, so the above example would result in a four-element list of [1,2,4,5]. But this would require a spec change as well because of the list support in CDI. WDYT?

@dmlloyd
Copy link
Contributor Author

dmlloyd commented Feb 13, 2019

/cc @jmesnil

@dmlloyd
Copy link
Contributor Author

dmlloyd commented May 7, 2019

A strongly related issue is the translation of empty strings into a single-element list of an empty string.

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 a pull request may close this issue.

1 participant