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

config names that contain -<number> format are not recognized #328

Closed
amylashley opened this issue Aug 2, 2022 · 3 comments
Closed

config names that contain -<number> format are not recognized #328

amylashley opened this issue Aug 2, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@amylashley
Copy link

I have a config variable of the format variable-2 and when I run the app I receive an error:

Caused by: com.sksamuel.hoplite.ConfigException: Error loading config because:

...

            - 'variable2': Missing from config
	at com.sksamuel.hoplite.ConfigLoader$returnOrThrow$1.invoke(ConfigLoader.kt:190)
	at com.sksamuel.hoplite.ConfigLoader$returnOrThrow$1.invoke(ConfigLoader.kt:187)
	at com.sksamuel.hoplite.fp.ValidatedKt.getOrElse(Validated.kt:98)
	at com.sksamuel.hoplite.ConfigLoader.returnOrThrow(ConfigLoader.kt:187)

I have to reformat it to variable2 for it to work.

@sksamuel
Copy link
Owner

sksamuel commented Aug 3, 2022

If you have variable-2 in yml, what's the name of the field in the data class. Is it variable2 ?

@sksamuel sksamuel added the bug Something isn't working label Aug 3, 2022
@sksamuel sksamuel self-assigned this Aug 3, 2022
@amylashley
Copy link
Author

Yes, that would be the variable name. A more specific example of my actual variable format (I tried to obfuscate my code) would be the config key variable-name-2 with a corresponding variable called variableName2.

@sksamuel
Copy link
Owner

sksamuel commented Aug 5, 2022

Fixed in 2.5.1

@sksamuel sksamuel closed this as completed Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants