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

when using hoplite-hikaricp properties are not marked as "used" #399

Open
clembo590 opened this issue Feb 8, 2024 · 0 comments
Open

when using hoplite-hikaricp properties are not marked as "used" #399

clembo590 opened this issue Feb 8, 2024 · 0 comments

Comments

@clembo590
Copy link

clembo590 commented Feb 8, 2024

when using hoplite-hikaricp properties are not marked as "used".

for example

application.conf

database {
  jdbcUrl = "jdbc:postgresql://localhost:5342/firstDatabase"
  username = "firstDbConnectionUserName"
  password = "firstDbConnectionPassword"
  driverClassName = "org.postgresql.Driver"
  maximumPoolSize = 10
}

and

data class MyConfig(val database: HikariDataSource)


    val myConfig = ConfigLoader {
        addResourceOrFileSource("/application.conf", optional = false)
        withReport()
    }.loadConfigOrThrow<MyConfig>()

then you can run this to test the loading of the configuration.

docker run -d --name first-database -p 127.0.0.1:5342:5432 -e POSTGRES_PASSWORD=firstDbConnectionPassword -e POSTGRES_USER=firstDbConnectionUserName -e POSTGRES_DB=firstDatabase postgres:9.6.12

  • first issue : the report is incorrect and show the properties as not used)
  • second issue: in strict mode it fails loading the configuration because the properties are not marked as used.

result:

Unused keys: 5
+--------------------------+-----------------------------+----------+
| Key | Source | Value |
+--------------------------+-----------------------------+----------+
| database.driverClassName | classpath:/application.conf | org***** |
| database.jdbcUrl | classpath:/application.conf | jdb***** |
| database.maximumPoolSize | classpath:/application.conf | 10 |
| database.password | classpath:/application.conf | fir***** |
| database.username | classpath:/application.conf | fir***** |
+--------------------------+-----------------------------+----------+

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

No branches or pull requests

1 participant