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
Strict configuration mode #763
Comments
So basically before setting a value this way we should check if it exists first? What about nested stuff, like template engine etc? How deep would it be 'strict'? Or does this mean that retreiving a configuration key which is not set would cause an error or something? |
@Ovid, care to answer per your vision? :) |
This is it? https://metacpan.org/pod/distribution/Dancer2/lib/Dancer2/Config.pod#strict_config-boolean-default:-false If so should we aim for transparency? I.e. should we allow $config->{value} for strict and non-strict mode as well? Or should strict mode be used like $config->value? |
In theory that's it, but as far as I can tell, the feature is documented by not implemented. See also: https://github.com/PerlDancer/Dancer2/search?utf8=%E2%9C%93&q=strict_config |
What the hell...? |
I'm just now realizing we still have stuff in the Config document that don't exist in D2. |
Having been bit by my own typos twice in the last two days, I am suddenly feeling the urge to work on this... keep you all posted. |
@DavsX - someone can correct me if I am wrong here, but I think objects in Moo are just blessed references to hashes. I don't think we prevent someone from accessing the internals of the config object if we try. All the same, I think if strict mode is enabled, the encouraged behavior needs to be config->setting. Spending some time this morning abusing Moo and seeing how to accomplish this. |
@DavsX - Any progress on this issue? |
Dancer 1 has a strict configuration mode that makes sure you don't hit configuration keys that don't have values (because you might have misspelled the key).
@Ovid requested we add it to Dancer2 as well.
The text was updated successfully, but these errors were encountered: