Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions api-playground/openapi-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
You can reference multiple OpenAPI specifications to create pages for your API. Either organize sections for each specification in your navigation or reference specific endpoints from different specifications.

<Note>
Mintlify supports `$ref` for **internal references only** within a single OpenAPI document. External references are not supported.

Check warning on line 16 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L16

Use 'aren't' instead of 'are not'.
</Note>

### Describe your API

We recommend the following resources to learn about and construct your OpenAPI specification.

Check warning on line 21 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L21

Try to avoid using first-person plural like 'We'.

- [Swagger's OpenAPI Guide](https://swagger.io/docs/specification/v3_0/basic-structure/) to learn the OpenAPI syntax.
- [The OpenAPI specification Markdown sources](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/) to reference details of the latest OpenAPI specification.
Expand Down Expand Up @@ -92,7 +92,7 @@
Common authentication types include:

- [API Keys](https://swagger.io/docs/specification/authentication/api-keys/): For header, query, or cookie-based keys.
- [Bearer](https://swagger.io/docs/specification/authentication/bearer-authentication/): For JWT or OAuth tokens.

Check warning on line 95 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L95

Spell out 'JWT', if it's unfamiliar to the audience.
- [Basic](https://swagger.io/docs/specification/authentication/basic-authentication/): For username and password.

If different endpoints within your API require different methods of authentication, you can [override the `security` field](https://swagger.io/docs/specification/authentication/#:~:text=you%20can%20apply%20them%20to%20the%20whole%20API%20or%20individual%20operations%20by%20adding%20the%20security%20section%20on%20the%20root%20level%20or%20operation%20level%2C%20respectively.) for a given operation.
Expand All @@ -101,7 +101,7 @@

## Customize your endpoint pages

Customize your endpoint pages by adding the `x-mint` extension to your OpenAPI specification. The `x-mint` extension provides additional control over how your API documentation is generated and displayed.

Check warning on line 104 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L104

In general, use active voice instead of passive voice ('is generated').

### Metadata

Expand Down Expand Up @@ -156,7 +156,7 @@
}
```

### Href

Check warning on line 159 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L159

'Href' should use sentence-style capitalization.

Change the URL of the endpoint page in your docs using `x-mint: href`. When `x-mint: href` is present, the navigation entry links directly to the specified URL instead of generating an API page.

Expand Down Expand Up @@ -221,7 +221,7 @@
"/users": {
"delete": {
"summary": "Delete user (admin only)",
// No `x-mint: mcp` so this endpoint is not exposed as an MCP tool

Check warning on line 224 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L224

Use 'isn't' instead of 'is not'.
// ...
}
}
Expand Down Expand Up @@ -257,11 +257,11 @@

Add an `openapi` field to any navigation element in your `docs.json` to automatically generate pages for OpenAPI endpoints. You can control where these pages appear in your navigation structure, as dedicated API sections or with other pages.

The `openapi` field accepts either a file path in your docs repo or a URL to a hosted OpenAPI document.

Check warning on line 260 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L260

Use 'path' instead of 'file path'.

Generated endpoint pages have these default metadata values:

- `title`: The operation's `summary` field, if present. If there is no `summary`, the title is generated from the HTTP method and endpoint.

Check warning on line 264 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L264

In general, use active voice instead of passive voice ('is generated').
- `description`: The operation's `description` field, if present.
- `version`: The `version` value from the parent anchor or tab, if present.
- `deprecated`: The operation's `deprecated` field. If `true`, a deprecated label appears next to the endpoint title in the side navigation and on the endpoint page.
Expand All @@ -277,7 +277,7 @@

### Dedicated API sections

Generate dedicated API sections by adding an `openapi` field to a navigation element and no other pages. All endpoints in the specification are included.

Check warning on line 280 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L280

In general, use active voice instead of passive voice ('are included').

```json {5}
"navigation": {
Expand Down Expand Up @@ -319,9 +319,93 @@
```

<Note>
The `directory` field is optional and specifies where generated API pages are stored in your docs repo. If not specified, defaults to the `api-reference` directory of your repo.

Check warning on line 322 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L322

In general, use active voice instead of passive voice ('are stored').
</Note>

#### Nested groups with endpoints

For large APIs with many endpoints, you can create multiple levels of nesting by placing groups within groups. Each nested group can reference specific endpoints from your OpenAPI specification.

```json
"navigation": {
"tabs": [
{
"tab": "API Reference",
"openapi": "/path/to/openapi.json",
"groups": [
{
"group": "Real-Time Communications",
"groups": [
{
"group": "Programmable Voice",
"groups": [
{
"group": "Call Control",
"pages": [
"GET /calls",
"POST /calls",
"POST /calls/{call_id}/actions/answer",
"POST /calls/{call_id}/actions/hangup"
]
},
{
"group": "Conferences",
"pages": [
"GET /conferences",
"POST /conferences",
"POST /conferences/{id}/actions/join"
]
}
]
},
{
"group": "Messaging",
"pages": [
"POST /messages",
"GET /messages/{id}"
]
}
]
},
{
"group": "Phone Numbers",
"groups": [
{
"group": "Number Management",
"pages": [
"GET /phone_numbers",
"GET /phone_numbers/{id}",
"PATCH /phone_numbers/{id}"
]
},
{
"group": "Number Search",
"pages": [
"GET /available_phone_numbers"
]
}
]
}
]
}
]
}
```

This creates a navigation hierarchy like:

Check warning on line 395 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L395

In general, don't use an ellipsis.
- **Real-Time Communications**
- **Programmable Voice**
- **Call Control**
- GET /calls
- POST /calls
- ...

Check warning on line 401 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L401

In general, don't use an ellipsis.
- **Conferences**
- GET /conferences
- ...
- **Messaging**
- POST /messages
- ...

### Selective endpoints

When you want more control over where endpoints appear in your documentation, you can reference specific endpoints in your navigation. This approach allows you to generate pages for API endpoints alongside other content. You can also use this approach to mix endpoints from different OpenAPI specifications.
Expand Down Expand Up @@ -358,7 +442,7 @@

#### OpenAPI spec inheritance

OpenAPI specifications are inherited down the navigation hierarchy. Child navigation elements inherit their parent's OpenAPI specification unless they define their own.

Check warning on line 445 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L445

In general, use active voice instead of passive voice ('are inherited').

```json {3, 7-8, 11, 13-14}
{
Expand All @@ -383,7 +467,7 @@

#### Individual endpoints

Reference specific endpoints without setting a default OpenAPI specification by including the file path. You can reference endpoints from multiple OpenAPI specifications in the same documentation section.

Check warning on line 470 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L470

Use 'path' instead of 'file path'.

```json {5-6}
"navigation": {
Expand Down Expand Up @@ -435,7 +519,7 @@

</CodeGroup>

The method and path must exactly match your OpenAPI spec. If you have multiple OpenAPI specifications, include the file path in your reference. External OpenAPI URLs can be referenced in `docs.json`.

Check warning on line 522 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L522

Use 'path' instead of 'file path'.

Check warning on line 522 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L522

In general, use active voice instead of passive voice ('be referenced').

#### Autogenerate endpoint pages

Expand All @@ -446,7 +530,7 @@
```

<Tip>
Add the `-o` flag to specify a folder to populate the files into. If a folder is not specified, the files will populate in the working directory.

Check warning on line 533 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L533

Use 'isn't' instead of 'is not'.

Check warning on line 533 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L533

Avoid using 'will'.
</Tip>

### Document data models
Expand Down Expand Up @@ -489,7 +573,7 @@

## Webhooks

Webhooks are HTTP callbacks that your API sends to notify external systems when events occur. Webhooks are supported in OpenAPI 3.1+ documents.

Check warning on line 576 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L576

In general, use active voice instead of passive voice ('are supported').

Add a `webhooks` field to your OpenAPI document alongside the `paths` field.

Expand Down