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

MP-config extension fails for empty values #4725

Closed
pa314159 opened this issue Feb 16, 2021 · 1 comment · Fixed by #4729
Closed

MP-config extension fails for empty values #4725

pa314159 opened this issue Feb 16, 2021 · 1 comment · Fixed by #4729
Assignees

Comments

@pa314159
Copy link
Contributor

pa314159 commented Feb 16, 2021

config.getPropertyNames().forEach(c -> properties.put(c, config.getValue(c, String.class)));

This line may fail if the value of the configuration is empty.

E.g. systems may set environment variables like this

export AN_EMPTY_VARIABLE=

MP-config trims all empty values to null so the invocation of

config.getValue("AN_EMPTY_VARIABLE", String.class)

fails with NoSuchElementException

@jansupol jansupol assigned Verdent and senivam and unassigned Verdent Feb 16, 2021
@senivam
Copy link
Contributor

senivam commented Feb 23, 2021

For the record:
MP-config empty properties handling behavior changed since MP config 2.0. Changes are described here: eclipse/microprofile-config#446
Following PR introduced changes to code: https://github.com/eclipse/microprofile-config/pull/598/files

for us this means that we shall handle external configs' properties handling more carefully.

Internal Jersey properties handling works without changes.

@senivam senivam linked a pull request Feb 23, 2021 that will close this issue
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.

3 participants