{% autoescape None %} FORMAT: 1A # {{ app_name }} API {{ app_name }} API Version {{ version }} {% for group_name, api_group in api_groups %} # Group {{ group_name }} {% for route, route_description in api_group %} {% if 'doc' in route_description %}## {{ route_description['doc'] }} [{{ route }}]{% end %} {% if 'details' in route_description %}{{ route_description['details'] }}{% end %} {% for method in ('GET', 'POST', 'PUT', 'PATCH', 'UPDATE', 'DELETE') %} {% if method in route_description %} ### {{ route_description[method]['doc'] }} [{{ method }} {{ route }}{{ route_description[method]['query_string'] }}] {% if 'details' in route_description[method] %}{{ route_description[method]['details'] }}{% end %} {% if 'parameters' in route_description[method] or 'query_parameters' in route_description[method] %} + Parameters {% for parameter_name, parameter in route_description[method].get('parameters', {}).iteritems() %} + {{ parameter_name }}: `{{ parameter['example'] }}` ({{ parameter.get('type', 'string') }}, required) - {{ parameter['description'] }} {% end %}{# end for each parameters #} {% for parameter_name, parameter in route_description[method].get('query_parameters', {}).iteritems() %} + {{ parameter_name }}: `{{ parameter['example'] }}` ({{ parameter.get('type', 'string') }}, optional) - {{ parameter['description'] }} {% end %}{# end for each query parameters #} {% end %}{# end if 'parameters' or 'query_parameters' #} {% if 'schema' in route_description[method] %} + Request + Body {{ indent_json(route_description[method]['example']) }} + Schema {{ indent_json(route_description[method]['schema']) }} {% end %}{# end if 'schema' #} {% for output in route_description[method].get('outputs', []) %} {% if 'code' in output %} + Response {{output['code']}} {% if 'description' in output %}{{ output['description'] }}{% end %} {% if 'headers' in output %} + Headers {% for header_name, header_example in output.get('headers', {}).iteritems() %} {{ header_name }}: {{ header_example }} {% end %}{# end for each 'headers' #} {% end %}{# end if 'headers' #} + Body {% if 'example' in output %} {{ indent_json(output['example']) }} {% if 'schema' in output %} + Schema {{ indent_json(output['schema']) }} {% end %}{# end if 'output_schema' #} {% end %}{# end if 'output_example' #} {% end %}{# end if 'output_code' #} {% end %}{# end for each 'outputs' #} {% for error in route_description[method].get('errors', []) %} + Response {{error['code']}} {% if 'description' in error %}{{ error['description'] }}{% end %} + Body {{ indent_json(error['example']) }} {% if 'schema' in error %} + Schema {{ indent_json(error['schema']) }} {% end %}{# end if 'schema' #} {% end %}{# end for each errors #} {% end %}{# end if method in route_description #} {% end %}{# end for method in ('GET', 'POST', 'PATCH', 'UPDATE', 'DELETE') #} {% end %}{# end for route, route_description in api_group #} {% end %}{# end for group_name, api_group in api_groups #}