The Wayback Machine - https://web.archive.org/web/20200917071101/https://github.com/rochacbruno/dynaconf/issues/115
Skip to content
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

Add a a way to specify descriptions and default values using dynaconf_validaors.toml #115

Open
dmfigol opened this issue Jan 22, 2019 · 5 comments

Comments

@dmfigol
Copy link

@dmfigol dmfigol commented Jan 22, 2019

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.

@rochacbruno
Copy link
Owner

@rochacbruno rochacbruno commented Jan 22, 2019

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 descriptions which would be only useful for printing and showing help message.

About the default values we can think about making dynaconf to look to the validation file before loading its data.

@rochacbruno rochacbruno changed the title Schema for dynaconf config Add a a way to specify descriptions and default values using dynaconf_validaors.toml Jan 22, 2019
@rochacbruno
Copy link
Owner

@rochacbruno rochacbruno commented Jan 22, 2019

thinking a bit more, in the same way we have .secrets. maybe we can add support for a special .defaults. file, so when it is present dynaconf loads it first.

@brucegibbins
Copy link

@brucegibbins brucegibbins commented Jan 22, 2019

@rochacbruno rochacbruno added this to the 1.2.1 milestone Mar 11, 2019
@rochacbruno rochacbruno removed this from the 1.2.x milestone Mar 29, 2019
@rochacbruno rochacbruno added this to the 3.0.0 milestone Apr 7, 2019
@rochacbruno
Copy link
Owner

@rochacbruno rochacbruno commented Apr 7, 2019

After #146 validators will be a plugin, then we can work on this

@rochacbruno
Copy link
Owner

@rochacbruno rochacbruno commented Sep 12, 2020

Now we can define default values using validators, the validators.toml is still missing this support

Details here: https://www.dynaconf.com/validation/#providing-default-or-computed-values

We still need

  • Define description/help for a setting value in the validator (or as a schema class)
  • Support description, default in toml validator
  • Add a way to generate initial settings file based on validator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.