Skip to content

error paths for additionalItems, additionalProperties and patternProperties #75

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

Merged

Conversation

gazpachoking
Copy link
Contributor

This fixes the additionalProperties error path problems issue in #74, which turns out was also affecting patternProperties and additionalItems.

This also fixes a problem with additionalItems, where it was not validating the correct items. See: gazpachoking@4a7ffc1#L0L221

…Properties

Fix additionalItems validating wrong items
@gazpachoking
Copy link
Contributor Author

We should add a test to the suite that would have caught the second error with wrong additionalItems being validated, surprised that slipped through.

@Julian
Copy link
Member

Julian commented Mar 3, 2013

Haven't played with this locally yet, but I have a feeling this is at least partially not a bug. What happens when you have {"additionalProperties" : False}? jsonschema has an (unwritten but we should add it to the docs) guarantee that the path to a thing on the instance always exists. I think from glancing at this it would break that guarantee?

If so I guess I understand that we do need to solve this but we have to think about it a bit more carefully.

@gazpachoking
Copy link
Contributor Author

In the case where additionalProperties is false, this block gets used https://github.com/gazpachoking/jsonschema/blob/4a7ffc107603e5a97462f5871f3c15a2f5430f1b/jsonschema.py#L196-L198 and nothing will be appended to the error path.

@Julian
Copy link
Member

Julian commented Mar 3, 2013

Ah, right. Forgot it's handled separately. Nice. OK well, if you think we can get #77 merged immediately and do a v1.0.1 with it then we can do that, otherwise feel free to merge this and then we'll merge your format exception thing and do a v1.1.0 along with #77.

gazpachoking added a commit that referenced this pull request Mar 3, 2013
error paths for additionalItems, additionalProperties and patternProperties
@gazpachoking gazpachoking merged commit 4129584 into python-jsonschema:master Mar 3, 2013
@gazpachoking gazpachoking mentioned this pull request Mar 3, 2013
@gazpachoking gazpachoking deleted the fix_error_paths branch March 3, 2013 05:28
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

Successfully merging this pull request may close these issues.

2 participants