ProductHint with allowUnknownKeys=false misbehaves
See original GitHub issueProductHint
with allowUnknownKeys=false
misbehaves with pureconfig.loadConfig
and pureconfig.loadConfigOrThrow
.
I made a demo project to show the issue. Here is the relevant section. This code does not reference application.conf
and should not try to pull in reference.conf
.
implicit val hint: ProductHint[PureConfigFun] = ProductHint[PureConfigFun](allowUnknownKeys = false)
pureconfig.loadConfigOrThrow[PureConfigFun](Paths.get("pure.conf"))
Here is the error:
pureconfig.error.ConfigReaderException: Cannot convert configuration to a value of class PureConfigFun. Failures are:
Other failures:
- UnknownKey(path,None)
- UnknownKey(file,None)
- UnknownKey(java,None)
- UnknownKey(os,None)
- UnknownKey(line,None)
- UnknownKey(user,None)
- UnknownKey(sun,None)
- UnknownKey(akka,None)
- UnknownKey(awt,None)
My app does not contain application.conf
. Based on the error message, it looks like PureConfig compares against reference.conf
, instead of just looking at pure.conf
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:20
Top Results From Across the Web
Product Hunt – The best new products in tech.
Product Hunt is a curation of the best new products, every day. Discover the latest mobile apps, websites, and technology products that everyone's...
Read more >Assembly - Product Information, Latest Updates, and Reviews ...
Assembly is a free employee engagement, recognition, and rewards platform (free for unlimited users). Raise the bar on recognition and help instill your ......
Read more >Product Hunt Launch Guide
Others in the community can upvote, comment, and share those products as they ... Comments and conversation also allow makers to gather feedback,...
Read more >Instagreen - Product Information, Latest Updates, and ...
Create a fake, eco-unfriendly online life. Follow for updates. Visit website. More. upvotes. 166. followers.
Read more >cdnjs/dexie.min.js.map at master · cdnjs/cdnjs · GitHub
n // Continue to next key but don't include this one.\n return false;\n } else {\n // cursor.key not yet at set[i]. Forward...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For the
UnknownKey
s errors, the issue is that the defaultfieldMapping
isKebabCase
. See the doc. But the keys in your configuration areCamelCase
. To configure to useCamelCase
as field mapping, change thehint
toAnd everything should work
@mslinn I’m closing this as resolved