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

allowing "unknown" properties #129

Closed
jmls opened this issue Mar 6, 2016 · 2 comments
Closed

allowing "unknown" properties #129

jmls opened this issue Mar 6, 2016 · 2 comments

Comments

@jmls
Copy link

jmls commented Mar 6, 2016

I want my app to have a single config.json file - but in this file there may be other properties that the enduser can customise (ie I have no idea what they may be called, and may be added outside of the application)

Can I use convict in this manner ? The conf.load() seems to load the json file without errors, but if I try and get a property that is not in the schema, it fails with the message "Error: cannot find configuration param "

thanks

@jmls
Copy link
Author

jmls commented Mar 14, 2016

bump - anyone got an idea on how this may be possible ?

@madarche
Copy link
Collaborator

@jmls: that's the way convict has been designed. When in non-strict mode convict allows properties undefined in the schema to be present, but not to manipulate them, because manipulation is done through the schema. If you sometimes want to access custom properties without convict doing its job, you can read the config.json file through another mean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants