-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
JSON schema does not add default values to configuration dictionary #81
Comments
The default values are used by UI generators, eg: in the admin interface of OpenWISP, or in the netjsonconfig-editor.js project on which @gastonche is working. Maybe there's a way to get a python dictionary filled with the default values of the schema via the jsonschema library, but I'm not sure. I understand that AirOS needs a full configuration in order to work, so you need to keep a default config somewhere, let's try to go deeper, what's exactly you need / want to do? Can you work around this need without introducing too much complexity to the library? |
I have been doing the defaults in the converters but I have many 'KeyError' poppings out during testing that (maybe) could be sorted out at jsonschema level
I think that yes I can do this without too much work but I should really look and see if jsonchema can do this on our behalf |
If you are still interested in breaking every tests we have in one commit here is what I have worked on https://github.com/EdoPut/netjsonconfig/tree/computer-do-the-thing |
Looks interesting. I'm a bit overloaded now, but at some point in the near future I want to go back to analyse what could possibly go wrong in changing the current implementation to adopt that change and make it work for all backends. |
Right now we have a lot of material specified in the schema for a backend but it is not used to fill the defaults for the user, so what is the benefit of having so much precise schema if it is not doing something for us?
Obviously this is a rant/question/"what would we like to do question", so please chime in and let's sort it out
The text was updated successfully, but these errors were encountered: