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): ...@@ -42,7 +42,7 @@ class JSONType(XMLObject):
, PropertySheet.TextDocument , 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. Validate contained JSON with the Schema defined in the Portal Type.
""" """
...@@ -60,4 +60,7 @@ class JSONType(XMLObject): ...@@ -60,4 +60,7 @@ class JSONType(XMLObject):
validator = jsonschema.validators.validator_for(defined_schema)(defined_schema, format_checker=jsonschema.FormatChecker()) 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 sorted(validator.iter_errors(current_schema), key=lambda e: e.path)
return err return err
return True return True
\ No newline at end of file
def validateJsonSchema(self, list_error=False):
return self.validateLocalJsonSchema(list_error=list_error)
\ No newline at end of file
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</item> </item>
<item> <item>
<key> <string>expression</string> </key> <key> <string>expression</string> </key>
<value> <string>python: object.validateJsonSchema()</string> </value> <value> <string>python: object.validateLocalJSONSchema()</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <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