@staticmethod<EOL><INDENT>def validate(template_dict, schema=None):<DEDENT>
if not schema:<EOL><INDENT>schema = SamTemplateValidator._read_schema()<EOL><DEDENT>validation_errors = "<STR_LIT>"<EOL>try:<EOL><INDENT>jsonschema.validate(template_dict, schema)<EOL><DEDENT>except ValidationError as ex:<EOL><INDENT>validation_errors = str(ex)<EOL>pass<EOL><DEDENT>return validation_errors<EOL>
Is this a valid SAM template dictionary

:param dict template_dict: Data to be validated
:param dict schema: Optional, dictionary containing JSON Schema representing SAM template
:return: Empty string if there are no validation errors in template