You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api-playground/openapi-setup.mdx
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,9 @@ To document your endpoints with OpenAPI, you need a valid OpenAPI document in ei
15
15
We recommend the following resources to learn about and construct your OpenAPI documents.
16
16
17
17
-[Swagger's OpenAPI Guide](https://swagger.io/docs/specification/v3_0/basic-structure/) to learn the OpenAPI syntax.
18
-
-[OpenAPI v3.1.0 Specification](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md) to reference details of the newest OpenAPI specification.
18
+
-[The OpenAPI specification Markdown sources](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/) to reference details of the latest OpenAPI specification.
19
19
-[Swagger Editor](https://editor.swagger.io/) to edit, validate, and debug your OpenAPI document.
20
-
- The [Mint CLI](https://www.npmjs.com/package/mint) to validate your OpenAPI document with the command: `mint openapi-check <openapiFilenameOrUrl>`.
20
+
-[The Mint CLI](https://www.npmjs.com/package/mint) to validate your OpenAPI document with the command: `mint openapi-check <openapiFilenameOrUrl>`.
21
21
22
22
<Note>
23
23
Swagger's OpenAPI Guide is for OpenAPI v3.0, but nearly all of the information is applicable to v3.1. For more information on the differences between v3.0 and v3.1, see [Migrating from OpenAPI 3.0 to 3.1.0](https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0) in the OpenAPI blog.
@@ -37,9 +37,9 @@ To enable Mintlify features like the API playground, add a `servers` field to yo
37
37
}
38
38
```
39
39
40
-
In an OpenAPI document, different API endpoints are specified by their paths, like `/users/{id}` or simply `/`. The base URL defines where these paths should be appended. For more information on how to configure the `servers` field, see the [Swagger documentation](https://swagger.io/docs/specification/api-host-and-base-path/).
40
+
In an OpenAPI document, different API endpoints are specified by their paths, like `/users/{id}` or simply `/`. The base URL defines where these paths should be appended. For more information on how to configure the `servers` field, see [API Server and Base Path](https://swagger.io/docs/specification/api-host-and-base-path/) in the OpenAPI documentation.
41
41
42
-
The API playground uses these server URLs to determine where to send requests. If multiple servers are specified, a dropdown will allow users to toggle between servers. If no server is specified, the API playground will use simple mode since it cannot send requests without a base.
42
+
The API playground uses these server URLs to determine where to send requests. If you specify multiple servers, a dropdown will allow users to toggle between servers. If you do not specify a server, the API playground will use simple mode since it cannot send requests without a base URL.
43
43
44
44
If your API has endpoints that exist at different URLs, you can [override the server field](https://swagger.io/docs/specification/v3_0/api-host-and-base-path/#overriding-servers) for a given path or operation.
45
45
@@ -87,28 +87,28 @@ Common authentication types include:
87
87
88
88
-[API Keys](https://swagger.io/docs/specification/authentication/api-keys/): For header, query, or cookie-based keys.
89
89
-[Bearer](https://swagger.io/docs/specification/authentication/bearer-authentication/): For JWT or OAuth tokens.
90
-
-[Basic](https://swagger.io/docs/specification/authentication/basic-authentication/): For username and password
90
+
-[Basic](https://swagger.io/docs/specification/authentication/basic-authentication/): For username and password.
91
91
92
92
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.
93
93
94
-
For more information on defining and applying authentication, see [Authentication](https://swagger.io/docs/specification/authentication/) in the Swagger documentation.
94
+
For more information on defining and applying authentication, see [Authentication](https://swagger.io/docs/specification/authentication/) in the OpenAPI documentation.
95
95
96
96
## Auto-populate API pages
97
97
98
-
You can add an `openapi`property to any navigation element in your `docs.json` to auto-populate your docs with a page for each specified endpoint. The `openapi` field can contain the path to an OpenAPI document in your docs repo or the URL of a hosted OpenAPI document.
98
+
You can add an `openapi`field to any navigation element in your `docs.json` to auto-populate your docs with a page for each specified endpoint. The `openapi` field can contain the path to an OpenAPI document in your docs repo or the URL of a hosted OpenAPI document.
99
99
100
100
The metadata for the generated pages will have the following default values:
101
101
102
102
-`title`: The `summary` field from the OpenAPI operation, if present. Otherwise a title generated from the HTTP method and endpoint.
103
103
-`description`: The `description` field from the OpenAPI operation, if present.
104
104
-`version`: The `version` value from the anchor or tab, if present.
105
-
-`deprecated`: The `deprecated` field from the OpenAPI operation, if present. If true, a deprecated label will appear next to the endpoint title in the side navigation and on the endpoint page.
105
+
-`deprecated`: The `deprecated` field from the OpenAPI operation, if present. If `true`, a deprecated label will appear next to the endpoint title in the side navigation and on the endpoint page.
106
106
107
107
<Tip>
108
108
If you have some endpoints in your OpenAPI schema that you want to exclude from your auto-populated API pages, add the [`x-hidden`](/api-playground/customization/managing-page-visibility#x-hidden) property to the endpoint.
109
109
</Tip>
110
110
111
-
### Example with tabs
111
+
### Example with navigation tabs
112
112
113
113
```json {5}
114
114
"navigation": {
@@ -121,7 +121,7 @@ The metadata for the generated pages will have the following default values:
121
121
}
122
122
```
123
123
124
-
### Example with groups
124
+
### Example with navigation groups
125
125
126
126
```json {8-11}
127
127
"navigation": {
@@ -148,11 +148,11 @@ The metadata for the generated pages will have the following default values:
148
148
149
149
## Create `MDX` files for API pages
150
150
151
-
If you want to customize the page metadata, add additional content, omit certain OpenAPI operations, or reorder OpenAPI pages in your navigation, you can create `MDX` pages for each operation. See an [example `MDX` OpenAPI page from MindsDB](https://github.com/mindsdb/mindsdb/blob/main/docs/rest/databases/create-databases.mdx) and how it appears in their [live documentation](https://docs.mindsdb.com/rest/databases/create-databases).
151
+
If you want to customize the page metadata, add additional content, omit certain OpenAPI operations, or reorder OpenAPI pages in your navigation, you can create `MDX` pages for each operation. See an [example `MDX` OpenAPI page from MindsDB](https://github.com/mindsdb/mindsdb/blob/main/docs/rest/databases/create-databases.mdx?plain=1) and how it appears in their [live documentation](https://docs.mindsdb.com/rest/databases/create-databases).
152
152
153
153
### Manually specify files
154
154
155
-
Create individual`MDX`pages and reference the OpenAPI operation in the pages' metadata using the `openapi` field.
155
+
Create an`MDX`page for each endpoint and specify which OpenAPI operation to display using the `openapi` field in the frontmatter.
156
156
157
157
When you reference an OpenAPI operation this way, the name, description, parameters, responses, and API playground are automatically generated from your OpenAPI document.
The method and path must exactly match the definition in your OpenAPI specification. If the endpoint doesn't exist in the OpenAPI file, the page will be empty.
189
189
190
-
For webhooks, use `webhook` (case insensitive) instead of the HTTP method (like `POST`) in your reference.
190
+
For webhooks, use `webhook` (case insensitive) instead of the HTTP method (like `GET` or `POST`) in your reference.
0 commit comments