Closed keathley closed 5 years ago
It sounds interesting. Type assertions during startup could definitely be helpful. I also like the idea of slimming down the getter syntax :)
In regards of specifying the types: How would, for instance, Env.with_prefix("APP")
be type notated?
I'm still trying to think through the api for this. I think part of the issue is that the specifications would have to be done per provider since each provider returns data in slightly different formats. I also don't know how this would work with something like the env providers with_prefix
option. But perhaps its better to just be explicit over convenient in this case.
I've been thinking about this a bit and I think that we should consider requiring the types for a given value when we define the configuration instead of doing it on the fly each time. There are tradeoffs to this approach which I'll try to list here:
Personally I think the benefits greatly outweigh the costs here but I may be missing something. Interested to see what y'all think.