def _add_api_to_swagger(self, event_id, event_properties, template):
<EOL>api_id = self._get_api_id(event_properties)<EOL>if isinstance(api_id, dict) or not template.get(api_id):<EOL><INDENT>raise InvalidEventException(event_id,<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>resource = template.get(api_id)<EOL>if not (resource and<EOL>isinstance(resource.properties, dict) and<EOL>SwaggerEditor.is_valid(resource.properties.get("<STR_LIT>"))):<EOL><INDENT>return<EOL><DEDENT>if not resource.properties.get("<STR_LIT>"):<EOL><INDENT>return<EOL><DEDENT>swagger = resource.properties.get("<STR_LIT>")<EOL>path = event_properties["<STR_LIT>"]<EOL>method = event_properties["<STR_LIT>"]<EOL>editor = SwaggerEditor(swagger)<EOL>editor.add_path(path, method)<EOL>resource.properties["<STR_LIT>"] = editor.swagger<EOL>template.set(api_id, resource)<EOL>
Adds the API path/method from the given event to the Swagger JSON of Serverless::Api resource this event
refers to.

:param string event_id: LogicalId of the event
:param dict event_properties: Properties of the event
:param SamTemplate template: SAM Template to search for Serverless::Api resources