Created
December 4, 2019 17:46
-
-
Save abhay-kumar/f27ba56b5e5caa3d142cc91633e6ab80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if resource.methods | length %} | |
{% for endpoint in resource.methods %} | |
### {{ endpoint.displayName | default(resource.relativeUri) | capitalize }} | |
{{ endpoint.description }} | |
``` | |
{{ endpoint.method | upper }} {{ resource.parentUrl }}{{ resource.relativeUri }} | |
``` | |
{% if endpoint.allUriParameters | length %} | |
URI Parameters | |
| Attribute | Type | Required | Description | | |
| --------- | ---- | -------- | ----------- | | |
{%- for param in endpoint.allUriParameters %} | |
| `{{ param.key }}` | {{ param.type }} | {{ 'yes' if param.required else 'no' }} | {{ param.description }} | | |
{%- endfor %} | |
{% endif %} | |
{% if endpoint.queryParameters | length %} | |
#### QueryString Parameters | |
| Attribute | Type | Required | Description | Example | | |
| --------- | ---- | -------- | ----------- | ------- | | |
{%- for param in endpoint.queryParameters %} | |
| `{{ param.key }}` | {{ param.type }} | {{ 'yes' if param.required else 'no' }} | {{ param.description }} | {{ param.examples }} | | |
{%- endfor %} | |
{% endif %} | |
{% if endpoint.body | length %} | |
{% if endpoint.body[0].properties %} | |
#### Request | |
| Name | Type | Required | | |
| ---- | ---- | -------- | | |
{%- for param in endpoint.body[0].properties %} | |
| {{ param.name }} | {{ param.type }} | {{ 'yes' if param.required else 'no' }} | | |
{%- endfor %} | |
{% endif %} | |
{% if endpoint.body[0].examples | length %} | |
##### Example | |
``` | |
{{ endpoint.body[0].examples[0].structuredValue | dump(2) }} | |
``` | |
{% endif %} | |
{% endif %} | |
{% if endpoint.responses %} | |
#### Responses | |
| Code | Description | | |
| ---- | ----------- | | |
{%- for response in endpoint.responses %} | |
| {{ response.code }} | {{ response.description }} | | |
{%- endfor %} | |
{%- for response in endpoint.responses %} | |
{% if response.body | length %} | |
{% if response.body[0].examples | length %} | |
##### {{ response.code }} Sample Response | |
``` | |
{{ response.body[0].examples[0].structuredValue | dump(2) }} | |
``` | |
{% endif %} | |
{% endif %} | |
{%- endfor %} | |
{% endif %} | |
--- | |
{%- endfor -%} | |
{% endif %} | |
{% for resource in resource.resources %} | |
{% include "./resource.njk" %} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment