def _extract_from_serverless_api(self, logical_id, api_resource, collector):
properties = api_resource.get("<STR_LIT>", {})<EOL>body = properties.get("<STR_LIT>")<EOL>uri = properties.get("<STR_LIT>")<EOL>binary_media = properties.get("<STR_LIT>", [])<EOL>if not body and not uri:<EOL><INDENT>LOG.debug("<STR_LIT>",<EOL>logical_id)<EOL>return<EOL><DEDENT>reader = SamSwaggerReader(definition_body=body,<EOL>definition_uri=uri,<EOL>working_dir=self.cwd)<EOL>swagger = reader.read()<EOL>parser = SwaggerParser(swagger)<EOL>apis = parser.get_apis()<EOL>LOG.debug("<STR_LIT>", len(apis), logical_id)<EOL>collector.add_apis(logical_id, apis)<EOL>collector.add_binary_media_types(logical_id, parser.get_binary_media_types())  <EOL>collector.add_binary_media_types(logical_id, binary_media)<EOL>
Extract APIs from AWS::Serverless::Api resource by reading and parsing Swagger documents. The result is added
to the collector.

Parameters
----------
logical_id : str
    Logical ID of the resource

api_resource : dict
    Resource definition, including its properties

collector : ApiCollector
    Instance of the API collector that where we will save the API information