Skip to content
Draft
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
16 changes: 14 additions & 2 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,15 @@

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'.

<Warning>
**Setting the `openapi` property on an anchor, tab, or group automatically generates pages for ALL endpoints in the OpenAPI specification.** This can significantly change your navigation structure and may be a breaking change if you have existing links or bookmarks to specific pages.

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

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L263

Spell out 'ALL', if it's unfamiliar to the audience.
</Warning>

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 268 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L268

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 +281,11 @@

### 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.
Generate dedicated API sections by adding an `openapi` field to a navigation element and no other pages. **All endpoints in the specification are automatically included.**

<Note>
When you add an `openapi` field to a navigation element without specifying individual pages, every endpoint defined in that OpenAPI specification will generate a page in your documentation. Review your specification to ensure you want all endpoints to be publicly documented.

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

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L287

Avoid using 'will'.
</Note>

```json {5}
"navigation": {
Expand All @@ -290,7 +298,7 @@
}
```

To organize multiple OpenAPI specifications in separate sections of your documentation, assign each specification to a different group in your navigation hierarchy. Each group can reference its own OpenAPI specification.
To organize multiple OpenAPI specifications in separate sections of your documentation, assign each specification to a different group in your navigation hierarchy. **Each group with an `openapi` field generates pages for all endpoints in its respective specification.**

```json {8-11, 15-18}
"navigation": {
Expand Down Expand Up @@ -318,8 +326,12 @@
}
```

<Warning>
In this example, the "Users API" group will generate pages for **every endpoint** in `users-openapi.json`, and the "Admin API" group will generate pages for **every endpoint** in `admin-openapi.json`. If you only want to include specific endpoints, use the [selective endpoints](#selective-endpoints) approach instead.

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

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L330

Avoid using 'will'.

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

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L330

Avoid using 'will'.
</Warning>

<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 334 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L334

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

### Selective endpoints
Expand Down Expand Up @@ -358,7 +370,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 373 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L373

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

```json {3, 7-8, 11, 13-14}
{
Expand All @@ -383,7 +395,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 398 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L398

Use 'path' instead of 'file path'.

```json {5-6}
"navigation": {
Expand Down Expand Up @@ -435,7 +447,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 450 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L450

Use 'path' instead of 'file path'.

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

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L450

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

#### Autogenerate endpoint pages

Expand All @@ -446,7 +458,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 461 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L461

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

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

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L461

Avoid using 'will'.
</Tip>

### Document data models
Expand Down Expand Up @@ -489,7 +501,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 504 in api-playground/openapi-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/openapi-setup.mdx#L504

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