parameters: (self, list_error=False)
return_statement: return True
docstring: Validate contained JSON with the Schema defined in the Portal Type.
docstring_summary: Validate contained JSON with the Schema defined in the Portal Type.
docstring_tokens: Validate contained JSON with the Schema defined in the Portal Type .
function: def validateLocalJSONSchema(self, list_error=False):
      """
      Validate contained JSON with the Schema defined in the Portal Type.
      """
      portal = self.getPortalObject()
      defined_schema = portal.portal_types[self.getPortalType()].getTextContent()
      text_content = self.asJSONText()
      if not defined_schema or text_content is None:
        # No errors if nothing is defined
        return True
      defined_schema = json.loads(defined_schema)
      current_schema = json.loads(text_content)
      try:
        jsonschema.validate(current_schema, defined_schema, format_checker=jsonschema.FormatChecker())
      except jsonschema.exceptions.ValidationError as err:
        if list_error:
          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
function_tokens: def validateLocalJSONSchema ( self , list_error = False ) : portal = self . getPortalObject ( ) defined_schema = portal . portal_types [ self . getPortalType ( ) ] . getTextContent ( ) text_content = self . asJSONText ( ) if not defined_schema or text_content is None : # No errors if nothing is defined return True defined_schema = json . loads ( defined_schema ) current_schema = json . loads ( text_content ) try : jsonschema . validate ( current_schema , defined_schema , format_checker = jsonschema . FormatChecker ( ) ) except jsonschema . exceptions . ValidationError as err : if list_error : 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