Open edyan opened 7 years ago
Thanks for the report!
For now the validate() method returns only the first encountered error. I would like to know if we can get all, in a dict for example: { 'keya': ["True is not of type 'string'"], 'keyb': ["True is not of type 'string'"] }
I'm not sure it's possible but will take some time to study it. Please wait for a while.
Also, I noticed that the doc here https://github.com/ssato/python-anyconfig/blob/master/anyconfig/schema.py#L45 is not up to date. safe is not part of options ;)
You're absolutely right I'll also look into this maybe this weekend.
I think that a couple of commits like 518d7bc improve the following:
Also, I noticed that the doc here https://github.com/ssato/python-anyconfig/blob/master/anyconfig/schema.py#L45 is not up to date. safe is not part of options ;)
You're absolutely right I'll also look into this maybe this weekend.
Very sorry to late reply.
I add support of this function in an experimental branch named 'schema'. Could you please look at the commit 6447858 (especially its test case) and try it if possible?
If it looks OK, I'll merge it.
Hi Satoru
Thanks for doing that. I would say it's not far from being perfect (from my point of view). The message is clear but .... (sorry for the bug) we don't know what messages belongs to what key.
In your example, I would expect :
{"a": ["'abc' is not of type 'boolean'"]}
If that's doable that would be great.
Thanks again Emmanuel
I took some time to accomplish what you want, but unfortunately, I think that it's very hard to do that w/o modifying jsonschema other than anyconfig.
Now, I merged the change I did as an workaround to master branch instead as an workaround and keep this issue open.
Hi,
For now the validate() method returns only the first encountered error. I would like to know if we can get all, in a dict for example:
{ 'keya': ["True is not of type 'string'"], 'keyb': ["True is not of type 'string'"] }
Also, I noticed that the doc here https://github.com/ssato/python-anyconfig/blob/master/anyconfig/schema.py#L45 is not up to date. safe is not part of options ;)
Thanks !