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

Unable to interpolate Integers? #57

Closed
peterfigure opened this issue May 19, 2020 · 3 comments
Closed

Unable to interpolate Integers? #57

peterfigure opened this issue May 19, 2020 · 3 comments
Labels

Comments

@peterfigure
Copy link

given

database {
  name = "servicedb"
  hostname = "db"
  port = 5432
}
flyway {
  url= "jdbc:postgresql://${database.hostname}:${database.port:-5432}/${database.name}"
}

it fails with

Caused by: com.uchuhimo.konf.source.WrongTypeException: source 5432 in [type: HOCON, url: file:/xxx/server/build/resources/main/application.conf, resource: application.conf] has type Integer rather than String
	at com.uchuhimo.konf.source.SourceKt.asValueOf(Source.kt:448) ~[konf-core-0.22.1.jar:na]
	at com.uchuhimo.konf.source.TreeLookup.lookup(Source.kt:407) ~[konf-core-0.22.1.jar:na]
	at org.apache.commons.text.lookup.InterpolatorStringLookup.lookup(InterpolatorStringLookup.java:151) ~[commons-text-1.8.jar:1.8]

is it possible to do this?

@peterfigure
Copy link
Author

a workaround is to define the value in the HOCON conf as a string

@stale
Copy link

stale bot commented Aug 22, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed.

@stale stale bot added the stale label Aug 22, 2020
@uchuhimo uchuhimo added 0.23.0 and removed stale labels Oct 8, 2020
@uchuhimo
Copy link
Owner

uchuhimo commented Oct 12, 2020

@peterfigure I have released a new version v0.23.0 that supports to interpolate Byte/Short/Int/Long/BigInteger/Char. You can try it now. Any further feedback is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants