mirror of
https://github.com/mintlify/docs.git
synced 2026-09-14 13:35:46 +08:00
017d7c7377
* fix: reduce Vale false positives via vocab and config updates - Make English-word vocab entries case-insensitive so sentence-start capitalization and normal prose usage stop flagging (agents, rest, cursor, setup, endpoints, etc.) - Add vocab entries for filenames and code identifiers that appear in frontmatter and JSX contexts (docs.json, llms.txt, CLAUDE.md, etc.) - Ignore openapi frontmatter lines, filenames, JSX attributes, email addresses, and internal link targets via TokenIgnores - Skip inline code scope and indented code fences - Add Headings exceptions for proper nouns (Claude Code, GitHub Actions, Route 53, GA4, etc.) - Disable linting for the all-code vercel-json-generator snippet Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: resolve all Vale warnings and errors across docs Content fixes: - Reword sentences using 'will', first person, spaced em dashes, 'e.g.', Latin abbreviations, and hyphenated adverbs - Sentence-case headings that started with dotted filenames - Backtick literal API values instead of bolding them - Move periods inside quotation marks - Fix Oxford comma rule misfires by restructuring sentences False-positive suppression: - Vale toggles around example user questions, keyboard shortcut keys (Cmd+I), UI labels, and code samples in JSX contexts that Vale misparses - Exclude vale toggle comments from the brace Token/BlockIgnores so in-document commands actually reach Vale (the greedy brace pattern was also silently swallowing large regions; now lazy) - Vocab entries for code identifiers (internal_id, handleSubmit, etc.) - Per-file rule disables for component docs with dotted JSX names and files where link-target linting ignores in-document toggles Result: vale --minAlertLevel warning is clean repo-wide; only suggestion-level items (Passive, Semicolons, Acronyms) remain. mint broken-links passes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: correct WordList rule instead of degrading prose - Restore sentence-start "Email" in advanced-support; the rule now only flags hyphenated e-mail/E-mail forms - Restore the idiom "above all else"; the above->preceding swap now exempts "above all" Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: restore deliberate prose flagged by blunt rules - Restore spatial 'above the navbar' / 'above a page title' in custom-scripts; the above->preceding swap now exempts 'above the/a/an' - Restore the '= ...' in the react-components named-export example (the ellipsis is inside inline code) with an Ellipses toggle - Restore SLA phrasing 'will use commercially reasonable efforts' with a Will toggle - Restore the quoted developer question in the GEO guide intro with a FirstPerson toggle, matching the file's other example questions Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: remove WordList swaps that flag legitimate English - Drop tablet->device and firewalls->firewall rules; both words are correct in ordinary prose - Narrow touch->tap to UI-instruction phrasing (touch the/a) so 'keep in touch' and 'touch devices' stop flagging Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: reposition vale toggles to wrap whole blocks Toggle comments placed between list items split the lists (restarting ol numbering in deployments) and comments flush against tables risked breaking GFM table parsing. Wrap entire lists/tables with blank-line separation instead. Verified rendering with mint dev: single ol with two items, tables intact, no comments in visible DOM. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * refactor: prune accept.txt to load-bearing entries Empirically removed 166 vocab entries (575 -> 409) whose removal causes no Vale flags across all 908 English pages: dictionary words that never needed listing (agents, setup, endpoints, webhooks, yaml), lowercase entries the speller already accepts, and filename entries made redundant by inline vale toggles. Kept every case-enforcing entry (API, JSON, GitHub, ...) so casing policy is unchanged, plus entries that double as capitalization exceptions for headings (mcp, md, auth, cursor, txt). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Update ai/mintlify-mcp.mdx * Update api/agent/v2/create-agent-job.mdx * chore: alphabetize Headings exceptions and accept.txt Case-insensitive sort, ignoring the (?i) prefix; also drops a duplicate Scala entry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: re-apply OxfordComma rewrite lost in branch merge Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs: resolve Vale suggestions batch 1 (acronyms, semicolons, passive voice) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs: resolve remaining Vale suggestions (passive voice batch 2) Rewrite ~90 passive constructions to active voice across deploy, guides, migration-services, and organize docs. Toggle the deliberate passive examples in the style-and-tone guide ('by zombies' test). Add axios/lodash vocab entries for a repositioned code example. vale . is now fully clean: 0 errors, 0 warnings, 0 suggestions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
202 lines
7.1 KiB
Plaintext
202 lines
7.1 KiB
Plaintext
---
|
|
title: "API settings"
|
|
description: "Configure OpenAPI and AsyncAPI specs, the interactive API playground, SDK code examples, and authentication settings in your docs.json file."
|
|
keywords: ["api", "openapi", "asyncapi", "playground", "docs.json", "api reference"]
|
|
---
|
|
|
|
Use the `api` field in `docs.json` to configure what API specifications generate API pages, the interactive API playground for testing endpoints, and how to generate and display code examples.
|
|
|
|
## Settings
|
|
|
|
### `api`
|
|
|
|
**Type:** `object`
|
|
|
|
Define all API-related settings under the `api` key.
|
|
|
|
<ResponseField name="api.openapi" type="string or array or object">
|
|
OpenAPI specification files for generating API reference pages. Accepts a single path or URL, an array of paths and URLs, or an object specifying a source and directory.
|
|
|
|
<Expandable title="api.openapi object">
|
|
<ResponseField name="source" type="string">
|
|
URL or path to your OpenAPI specification file. Minimum length: 1.
|
|
</ResponseField>
|
|
<ResponseField name="directory" type="string">
|
|
Directory to search for OpenAPI files. Do not include a leading slash.
|
|
</ResponseField>
|
|
</Expandable>
|
|
|
|
<CodeGroup>
|
|
|
|
```json Single file
|
|
"openapi": "openapi.json"
|
|
```
|
|
|
|
```json Multiple files
|
|
"openapi": [
|
|
"openapi/v1.json",
|
|
"openapi/v2.json",
|
|
"https://api.example.com/openapi.yaml"
|
|
]
|
|
```
|
|
|
|
```json Directory
|
|
"openapi": {
|
|
"source": "openapi.json",
|
|
"directory": "api-reference"
|
|
}
|
|
```
|
|
|
|
</CodeGroup>
|
|
</ResponseField>
|
|
|
|
<ResponseField name="api.asyncapi" type="string or array or object">
|
|
AsyncAPI specification files for generating event-driven API reference pages. Accepts a single path or URL, an array of paths and URLs, or an object specifying a source and directory.
|
|
|
|
<Expandable title="api.asyncapi object">
|
|
<ResponseField name="source" type="string">
|
|
URL or path to your AsyncAPI specification file. Minimum length: 1.
|
|
</ResponseField>
|
|
<ResponseField name="directory" type="string">
|
|
Directory to search for AsyncAPI files. Do not include a leading slash.
|
|
</ResponseField>
|
|
</Expandable>
|
|
|
|
<CodeGroup>
|
|
|
|
```json Single file
|
|
"asyncapi": "asyncapi.json"
|
|
```
|
|
|
|
```json Multiple files
|
|
"asyncapi": [
|
|
"asyncapi/events.yaml",
|
|
"asyncapi/webhooks.yaml"
|
|
]
|
|
```
|
|
|
|
```json Directory
|
|
"asyncapi": {
|
|
"source": "asyncapi.json",
|
|
"directory": "websockets"
|
|
}
|
|
```
|
|
|
|
</CodeGroup>
|
|
</ResponseField>
|
|
|
|
<ResponseField name="api.playground" type="object">
|
|
Interactive API playground settings.
|
|
|
|
<Expandable title="api.playground">
|
|
<ResponseField name="display" type='"interactive" | "simple" | "none" | "auth"'>
|
|
The display mode for the playground. Defaults to `interactive`.
|
|
|
|
- `interactive` — Full interactive playground with request builder
|
|
- `simple` — Simplified view without the request builder
|
|
- `none` — Hide the playground entirely
|
|
- `auth` — Show the playground only to authenticated users
|
|
</ResponseField>
|
|
<ResponseField name="proxy" type="boolean">
|
|
Whether to route API requests through a proxy server. Defaults to `true`.
|
|
</ResponseField>
|
|
<ResponseField name="credentials" type="boolean">
|
|
Whether to include cookies and authentication headers for cross-origin requests when `proxy` is `false`. Defaults to `false`. Has no effect when `proxy` is `true`.
|
|
</ResponseField>
|
|
</Expandable>
|
|
</ResponseField>
|
|
|
|
<ResponseField name="api.params" type="object">
|
|
Display settings for API parameters.
|
|
|
|
<Expandable title="api.params">
|
|
<ResponseField name="expanded" type='"all" | "closed"'>
|
|
Whether to expand all parameters by default. Defaults to `closed`.
|
|
</ResponseField>
|
|
<ResponseField name="post" type="array of string">
|
|
OpenAPI spec field keys to surface as post pills next to every parameter name in API reference pages and the playground. For each key you list, Mintlify reads the value from the schema and renders it as a pill:
|
|
|
|
- String values render as the verbatim string.
|
|
- `true` renders the key name as the pill label. `false`, `null`, and empty strings render nothing.
|
|
- Number values render the stringified number.
|
|
- Arrays of strings or numbers render one pill per element.
|
|
- Objects and other values are skipped.
|
|
|
|
Use this to expose custom OpenAPI fields—such as `x-internal`, `nullable`, or vendor extensions—as visual annotations on each parameter without per-property configuration.
|
|
</ResponseField>
|
|
</Expandable>
|
|
</ResponseField>
|
|
|
|
<ResponseField name="api.url" type='"full"'>
|
|
Display mode for the base URL in the endpoint header. Set to `full` to always show the complete base URL on every endpoint page. By default, the base URL is only shown when there are multiple base URLs to select from.
|
|
</ResponseField>
|
|
|
|
<ResponseField name="api.examples" type="object">
|
|
Settings for autogenerated API code examples.
|
|
|
|
<Expandable title="api.examples">
|
|
<ResponseField name="languages" type="array of string">
|
|
Languages for autogenerated code snippets. See [supported languages](/api-playground/overview#all-supported-languages) for the full list of available languages and aliases.
|
|
</ResponseField>
|
|
<ResponseField name="defaults" type='"required" | "all"'>
|
|
Whether to include optional parameters in generated examples. Defaults to `all`.
|
|
</ResponseField>
|
|
<ResponseField name="prefill" type="boolean">
|
|
Whether to prefill the playground with example values from your OpenAPI specification. Defaults to `false`.
|
|
</ResponseField>
|
|
<ResponseField name="autogenerate" type="boolean">
|
|
Whether to generate code samples for endpoints from your API specification. Defaults to `true`. When set to `false`, only manually written code samples (from `x-codeSamples` in OpenAPI or `<RequestExample>` components in MDX) appear in the playground.
|
|
</ResponseField>
|
|
</Expandable>
|
|
</ResponseField>
|
|
|
|
<ResponseField name="api.mdx" type="object">
|
|
Settings for API pages built from MDX files rather than OpenAPI specs.
|
|
|
|
<Expandable title="api.mdx">
|
|
<ResponseField name="auth" type="object">
|
|
Authentication configuration for MDX-based API requests.
|
|
|
|
<Expandable title="auth">
|
|
<ResponseField name="method" type='"bearer" | "basic" | "key" | "cobo"'>
|
|
Authentication method for API requests.
|
|
</ResponseField>
|
|
<ResponseField name="name" type="string">
|
|
Authentication parameter name for API requests.
|
|
</ResponseField>
|
|
</Expandable>
|
|
</ResponseField>
|
|
<ResponseField name="server" type="string or array">
|
|
Base URL prepended to relative paths in page-level `api` frontmatter fields. Not used when the frontmatter contains a full URL.
|
|
</ResponseField>
|
|
</Expandable>
|
|
</ResponseField>
|
|
|
|
## Example
|
|
|
|
{/* vale off */}
|
|
|
|
```json docs.json
|
|
{
|
|
"api": {
|
|
"openapi": ["openapi/v1.json", "openapi/v2.json"],
|
|
"playground": {
|
|
"display": "interactive"
|
|
},
|
|
"params": {
|
|
"expanded": "all",
|
|
"post": ["nullable", "x-internal"]
|
|
},
|
|
"url": "full",
|
|
"examples": {
|
|
"languages": ["curl", "python", "javascript", "go"],
|
|
"defaults": "required",
|
|
"prefill": true,
|
|
"autogenerate": true
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
{/* vale on */}
|