Closed glaslos closed 11 years ago
This might work: http://www.alexconrad.org/2011/10/json-validation.html
Pls check this https://gist.github.com/4642802
Both the parameters(port and reconn_attempts) are passed as string and not as int.
Well I would prefer to have the as int from the beginning i.e. set in the configuration file. Do you have a reason why you want to have them as strings? Please add this to your pull request.
I am fine with that . How would you want this to be integrated . Suggestion is to have it as a validate.py under modules.util and reference it for all json validations. Going forward we can also add http and other protocols.
Main reason why it was kept as a string was to avoid the initial errors, since the template.set file is currently passing both the parameters as string and it will fail on the validation part.
With code being accepted this issue can be moved to closure.
We need a way to validate a settings file according to the assigned protocol