Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd a a way to specify descriptions and default values using dynaconf_validaors.toml #115
Comments
Yeah the validators are the way to go https://dynaconf.readthedocs.io/en/latest/guides/validation.html It would be easy to include support for About the default values we can think about making dynaconf to look to the validation file before loading its data. |
thinking a bit more, in the same way we have |
I think this would be a great addition as well. Something that could help validate the config file. Especially looking for required elements or a key that exists but is missing a value or perhaps checking against valid value list
Cheers
-------- Original message --------From: Dmitry Figol <[email protected]> Date: 23/1/19 4:24 am (GMT+10:00) To: rochacbruno/dynaconf <[email protected]> Cc: Subscribed <[email protected]> Subject: [rochacbruno/dynaconf] Schema for dynaconf config (#115)
Hi,
thank you for the library. It really improved the way I approach configuration files.
Finally I have types and proper sections.
What I am missing is schema: I would love to be able to enforce that some parameters are obligatory, their type and provide a description, also raise an exception if there is some unknown parameter is configured.
I think I could use something like marshmallow for that, but if it is part of this library, it would be great for my use-cases.
What do you think?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/rochacbruno/dynaconf","title":"rochacbruno/dynaconf","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/rochacbruno/dynaconf"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Schema for dynaconf config (#115)"}],"action":{"name":"View Issue","url":"#115"}}}
[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "#115",
"url": "#115",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]
|
After #146 validators will be a plugin, then we can work on this |
Now we can define default values using validators, the Details here: https://www.dynaconf.com/validation/#providing-default-or-computed-values We still need
|
Hi,
thank you for the library. It really improved the way I approach configuration files.
Finally I have types and proper sections.
What I am missing is schema: I would love to be able to enforce that some parameters are obligatory, their type and provide a description, also raise an exception if there is some unknown parameter is configured.
I think I could use something like
marshmallow
for that, but if it is part of this library, it would be great for my use-cases.What do you think?
UPD: after looking at the docs more, I think validators would solve majority of our use-cases, but I don't see a way to specify descriptions and default values in a nice way, so that they are automatically populated in our docs.