Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Update API template #7709

Merged
merged 11 commits into from
Jul 24, 2024
38 changes: 24 additions & 14 deletions templates/API_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,33 @@ POST /_example/endpoint/<path_parameter>

The following table lists the available path parameters. All path parameters are optional.

| Parameter | Data type | Description |
| Parameter | Type | Description |
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
| :--- | :--- | :--- |
| `path_parameter` | Type | Example path parameter description. Default is ... |

## Query parameters

The following table lists the available query parameters. All query parameters are optional.

| Parameter | Data type | Description |
| Parameter | Type | Description |
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
| :--- | :--- | :--- |
| `query_parameter` | String | Example query parameter description. Default is ... |

## Request fields
## Request body fields

The following table lists the available request fields.
The following table lists the available request body fields.

| Field | Data type | Description |
| :--- | :--- | :--- |
| `example_object` | Object | Example object description. |
| `example_object.required_request_field` | Type | Required request field description. Required. |
| `example_object.optional_request_field` | Type | Optional request field description. Optional. Default is ... |

#### Example request
## Example request

**TIP:** If multiple examples exist for the request, seperate those examples using an `h3` header underneath this section. Some request examples will also require an additional explanation.

The following example shows an API request:

```json
POST /_example/endpoint/
Expand All @@ -57,7 +61,19 @@ POST /_example/endpoint/
```
{% include copy-curl.html %}

#### Example response
## Response body fields

The following table lists all response body fields.

| Field | Data type | Description |
| :--- | :--- | :--- |
| `response_field` | Type | Response field description. |

## Example response

**TIP:** If multiple response examples exist for the request, seperate those examples using an `h3` header underneath this section. Some example responses will require an additional explanation.

The following example shows an API response:

<details open markdown="block">
<summary>
Expand All @@ -76,14 +92,8 @@ POST /_example/endpoint/
```
</details>

## Response fields

The following table lists all response fields.

| Field | Data type | Description |
| :--- | :--- | :--- |
| `response_field` | Type | Response field description. |

## Required permissions

If you use the Security plugin, make sure you have the appropriate permissions: `cluster:example/permission/name`.


Loading