Confirmed for glance: https://bugs.launchpad.net/glance/+bug/1596598
See Model.validate() warlock/model.py: if self.resolver is set, it is passed to jsonschema.validate(). Here is the diff:
@@ -130,6 +137,9 @@ class Model(dict): def validate(self, obj): """Apply a JSON schema to an object""" try: - jsonschema.validate(obj, self.schema) + if self.resolver is not None: + jsonschema.validate(obj, self.schema, resolver=self.resolver) + else: + jsonschema.validate(obj, self.schema) except jsonschema.ValidationError as exc: raise exceptions.ValidationError(str(exc))
Here, self.resolver is a SchemaBasedModel instance. We should probably write a "resolving" method for this class, WDYT?
Confirmed for glance: https:/ /bugs.launchpad .net/glance/ +bug/1596598
See Model.validate() warlock/model.py: if self.resolver is set, it is passed to jsonschema. validate( ). Here is the diff:
@@ -130,6 +137,9 @@ class Model(dict): validate( obj, self.schema) validate( obj, self.schema, resolver= self.resolver) validate( obj, self.schema) ValidationError as exc: ValidationError (str(exc) )
def validate(self, obj):
"""Apply a JSON schema to an object"""
try:
- jsonschema.
+ if self.resolver is not None:
+ jsonschema.
+ else:
+ jsonschema.
except jsonschema.
raise exceptions.
Here, self.resolver is a SchemaBasedModel instance. We should probably write a "resolving" method for this class, WDYT?