parameters: (self, json_data, 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 validateJSON(self, json_data, list_error=False):
      """
      Validate contained JSON with the Schema defined in the Portal Type.
      """
      if not json_data:
        return True
      defined_schema = json.loads(self.getTextContent() or "")
      try:
        jsonschema.validate(json_data, 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 {
            defined_schema["$id"].decode(): [
              ("Validation Error", x.message) for x in sorted(validator.iter_errors(json_data), key=lambda e: e.path)
            ]
          }
        return err
      return True
function_tokens: def validateJSON ( self , json_data , list_error = False ) : if not json_data : return True defined_schema = json . loads ( self . getTextContent ( ) or "" ) try : jsonschema . validate ( json_data , 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 { defined_schema [ "$id" ] . decode ( ) : [ ( "Validation Error" , x . message ) for x in sorted ( validator . iter_errors ( json_data ) , key = lambda e : e . path ) ] } return err return True