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
+56-55Lines changed: 56 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,48 +8,47 @@ description: "Reference OpenAPI endpoints in your docs pages"
8
8
To describe your endpoints with OpenAPI, make sure you have a valid OpenAPI
9
9
document in either JSON or YAML format that follows the
10
10
[OpenAPI specification](https://swagger.io/specification/). Your document must
11
-
follow OpenAPI specification 3.0+.
11
+
follow OpenAPI specification 3.0+.
12
+
<Tip>To validate your OpenAPI spec, use our [CLI](https://www.npmjs.com/package/mintlify) and run this command: <br/>`mintlify openapi-check <openapiFilenameOrUrl>`</Tip>
12
13
13
14
## Auto-populate API pages
14
15
15
-
The fastest way to get started with OpenAPI is to add an `openapi` field to a tab or anchor in the `docs.json`. This field can contain either the path to an OpenAPI document in your docs repo, or the URL of a hosted OpenAPI document. Mintlify will automatically generate a page for each OpenAPI operation and place them in the tab/anchor.
16
+
The fastest way to get started with OpenAPI is to add an `openapi` field to a tab in the `docs.json`. This field can contain either the path to an OpenAPI document in your docs repo, or the URL of a hosted OpenAPI document. Mintlify will automatically generate a page for each OpenAPI operation and place them in the tab.
<Tip>To validate your OpenAPI spec, you can use this command: <br/>`mintlify openapi-check <openapiFilenameOrUrl>`</Tip>
51
-
52
-
53
52
When using this option, the metadata for the generated pages will have the following default values:
54
53
55
54
*`title`: The `summary` field from the OpenAPI operation, if present. Otherwise a title generated from the HTTP method and endpoint.
@@ -62,39 +61,9 @@ There are some scenarios in which the default behavior isn't sufficient. If you
62
61
63
62
## Create MDX files for API pages
64
63
65
-
If you want to customize the page metadata, add additional content, omit certain OpenAPI operations, or reorder OpenAPI pages in your navigation, you'll need an MDX page for each operation. Here is [an example MDX OpenAPI page](https://github.com/elevenlabs/elevenlabs-docs/blob/e5e267c97b8d1e4c21db1dcdb8b005eb1dfed7da/api-reference/speech-to-speech.mdx?plain=1#L2) from [Elevenlabs](https://elevenlabs.io/docs/api-reference/speech-to-speech). 
For large OpenAPI documents, creating one MDX page for each OpenAPI operation can be a lot of work. To make it easier, we created a local OpenAPI page scraper.
Learn more about our scraping package [here](https://www.npmjs.com/package/@mintlify/scraping).
89
-
90
-
The scraper will output an array of
91
-
[Navigation entries](/settings/global#structure) containing your OpenAPI MDX
92
-
files. You can either append these entries to your existing Navigation, or
93
-
reorder and add the files to your navigation manually.
64
+
If you want to customize the page metadata, add additional content, omit certain OpenAPI operations, or reorder OpenAPI pages in your navigation, you'll need an MDX page for each operation. Here is [an example MDX OpenAPI page](https://github.com/mindsdb/mindsdb/blob/main/docs/rest/databases/create-databases.mdx) from [MindsDB](https://docs.mindsdb.com/rest/databases/create-databases). 
94
65
95
-
<Note>
96
-
If your OpenAPI document is invalid, the files will not autogenerate.
97
-
</Note>
66
+

98
67
99
68
### Manually specify files
100
69
@@ -132,6 +101,38 @@ only one OpenAPI file - it will automatically detect your OpenAPI file.
132
101
the page will be empty.
133
102
</Note>
134
103
104
+
### Autogenerate files
105
+
106
+
For large OpenAPI documents, creating one MDX page for each OpenAPI operation can be a lot of work. To make it easier, we created a local OpenAPI page scraper.
0 commit comments