You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Draft3Validator we could easily determine programatically which required field was missing by looking at ValidationError.
Draft3 set the attribute that was missing in path. That way we could programatically see what property was missing:
def properties_draft3(validator, properties, instance, schema):
if not validator.is_type(instance, "object"):
return
for property, subschema in iteritems(properties):
if property in instance:
for error in validator.descend(
instance[property],
subschema,
path=property,
schema_path=property,
):
yield error
elif subschema.get("required", False):
error = ValidationError("%r is a required property" % property)
error._set(
validator="required",
validator_value=subschema["required"],
instance=instance,
schema=schema,
)
error.path.appendleft(property)
error.schema_path.extend([property, "required"])
yield error
In Draft4 however, these attributes aren't set anymore:
def required_draft4(validator, required, instance, schema):
if not validator.is_type(instance, "object"):
return
for property in required:
if property not in instance:
yield ValidationError("%r is a required property" % property)
Is there a way to get the old behaviour back?
The text was updated successfully, but these errors were encountered:
e68ff511 Straight up copy Draft 7 tests to Draft 2019-06.
1bd999ac Merge pull request #263 from juxt/master
a43c1d17 Add second Clojure implementation
eadeacb0 Merge pull request #262 from leadpony/fix-ref
3aa8d8fc Fix $ref value as properly percent-encoded.
8feaea4f The test suite schema is draft 4, not draft3 anymore.
git-subtree-dir: json
git-subtree-split: e68ff51148e0acd3476ea6937689552d3dc34a3e
In the Draft3Validator we could easily determine programatically which required field was missing by looking at
ValidationError
.Draft3 set the attribute that was missing in
path
. That way we could programatically see what property was missing:In Draft4 however, these attributes aren't set anymore:
Is there a way to get the old behaviour back?
The text was updated successfully, but these errors were encountered: