From 928c3d38c7c0ccf18c3f68febde4888652a2e246 Mon Sep 17 00:00:00 2001 From: Guido Dassori Date: Sun, 25 Oct 2015 12:24:23 +0100 Subject: Add path into extras Invalidating extras doesn't provide the involved property name into ValidationError.path, as other validators seems do. --- jsonschema/_validators.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'jsonschema/_validators.py') diff --git a/jsonschema/_validators.py b/jsonschema/_validators.py index 40fe340..0d9cace 100644 --- a/jsonschema/_validators.py +++ b/jsonschema/_validators.py @@ -30,7 +30,8 @@ def additionalProperties(validator, aP, instance, schema): yield error elif not aP and extras: error = "Additional properties are not allowed (%s %s unexpected)" - yield ValidationError(error % _utils.extras_msg(extras)) + yield ValidationError(error % _utils.extras_msg(extras), + path=(extras)) def items(validator, items, instance, schema): -- cgit v1.2.1