Commit bc94580f authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_json_type: use validateLocalJsonSchema to validate local schema

parent bc2135f8
......@@ -42,7 +42,7 @@ class JSONType(XMLObject):
, PropertySheet.TextDocument
)
def validateJsonSchema(self, list_error=False):
def validateLocalJsonSchema(self, list_error=False):
"""
Validate contained JSON with the Schema defined in the Portal Type.
"""
......@@ -60,4 +60,7 @@ class JSONType(XMLObject):
validator = jsonschema.validators.validator_for(defined_schema)(defined_schema, format_checker=jsonschema.FormatChecker())
return sorted(validator.iter_errors(current_schema), key=lambda e: e.path)
return err
return True
\ No newline at end of file
return True
def validateJsonSchema(self, list_error=False):
return self.validateLocalJsonSchema(list_error=list_error)
\ No newline at end of file
......@@ -26,7 +26,7 @@
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: object.validateJsonSchema()</string> </value>
<value> <string>python: object.validateLocalJSONSchema()</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment