hey folks! I’ve been playing around with annotatio...
# getting-started
hey folks! I’ve been playing around with annotations in this repo https://github.com/lucapette/konfig I’d love someone experienced in writing annotations to have a look at it. I found a bunch a config libraries but liked none of the api. So I thought this was a fun exercise. I’ll provide more context in the thread
I like how I can annotate config data classes
but I really don’t like I’ve got a global
val konfig
. It’s there because 1) I need to call
2) definitely don’t want to read configuration every time there’s a
val foo by injectKonfig<Bar>()
why not change your API to
Copy code
val konfig = Konfig("application.properties")
// then pass konfig to
val serverConfig: ServerConfig by konfig
thank you for the suggestion! It looks intriguing 🙂 The reason the current api looks that way: I wanted to avoid having to carry around the konfig instance. But maybe it’s good compromise. I’ll play around with this