Skip to content

Report multiple 'leaf' errors rather than one schema error#51

Closed
leonid-s-usov wants to merge 1 commit intopython-jsonschema:masterfrom
leonid-s-usov:master
Closed

Report multiple 'leaf' errors rather than one schema error#51
leonid-s-usov wants to merge 1 commit intopython-jsonschema:masterfrom
leonid-s-usov:master

Conversation

@leonid-s-usov
Copy link
Copy Markdown

Add ability to report all errors in case multiple nested types fail validation

With this change only simple type errors are reported - one will never
see an error saying that ' { "some" : "object" }' is not of type '{
"some": "schema" }'

…alidation

With this change only simple type errors are reported - one will never
see an error saying that ' { "some" : "object" }' is not of type '{
"some": "schema" }'
@leonid-s-usov
Copy link
Copy Markdown
Author

Hi Julian,

this is a follow up of the issue #50 - I am now using my personal account

@Julian
Copy link
Copy Markdown
Member

Julian commented Jan 6, 2013

Hey!

I didn't get a chance to play with this yet, but like I mentioned on #50, I like the idea that each validation error is a distinct thing wrong with the schema (so a schema with 3 errors had there distinct things wrong with it). If I understand what this pull request does, it would break that assumption, since now you'd get multiple errors that all essentially mean that something wasn't exactly the right type.

I really do think that the debug mode that I have in mind would help out here if your objective is to make it easier to see by inspection why a type check failed (and is even more useful in the general case), so let me do the 0.8 release (I'm missing some docs which is what's holding up the release) and then after that I'll show you what I have in mind and we can see if it helps this.

@Julian
Copy link
Copy Markdown
Member

Julian commented Feb 19, 2013

Haven't forgotten about this either :). But it probably will wait till after 1.0.0 is released unfortunately.

Also, reminding myself that the schema in #67 is a good example of one that produces a type message that is too hard to understand.

@gazpachoking
Copy link
Copy Markdown
Contributor

I think #86 will take care of this when we get it in, the leaf errors will be in error.context

@Julian
Copy link
Copy Markdown
Member

Julian commented Apr 10, 2013

I was thinking the same thing, yeah.

@leonid-s-usov sorry this took so long, but check out what just landed, see if it satisfies the use case you're trying to address. Feel free to reopen if you have more ideas.

I still have a debug mode planned at some point too...

@Julian Julian closed this Apr 10, 2013
Julian added a commit that referenced this pull request Feb 20, 2014
0ba6722 As per the spec, only dotted-quad is an acceptable format for IPv4 addresses.
6c3ca30 Merge pull request #51 from ericgj/add/validator
9cbcd43 Merge pull request #50 from ericgj/add/not-blank-schema-test
78bccaf add json-schema-valid to list of validators
4fe00e9 add 'forbidden property' test (not with blank schema)
cd2aa75 Merge pull request #49 from Acubed/develop
1186813 Add the enum/required test to draft4 too
30ca2fd Add tests for required/not required values with enums
ae3050a Add Jsonary and tv4 to the list
6c02fd0 Merge pull request #47 from iclanzan/patch-1
dff064d Added Jassi library to the list.

git-subtree-dir: json
git-subtree-split: 0ba672265758f09405b14a6508ff696a35e857ca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Some new desired functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants