Skip to content

Commit 999e2c6

Browse files
authored
Merge branch 'main' into legacy-pricing
2 parents f319d00 + c83c73f commit 999e2c6

File tree

108 files changed

+2219
-802
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+2219
-802
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.DS_Store
22
node_modules
33
package-lock.json
4+
.idea/
5+
.vscode/

advanced/rest-api/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ functionality to the API overtime. Let us know what else you want to see in
1414
## Authentication
1515

1616
You can generate an API key through
17-
[the dashboard](https://dashboard.mintlify.com/settings/api). The API key is
17+
[the dashboard](https://dashboard.mintlify.com/settings/integrations). The API key is
1818
associated with the entire org and can be used across multiple deployments.
1919

2020
<Frame>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
---
22
openapi: "POST /project/update/{projectId}"
3+
hideApiMarker: true
34
---
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
---
22
openapi: "GET /project/update-status/{statusId}"
3+
hideApiMarker: true
34
---

advanced/subpath/cloudflare.mdx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: "Host documentation at a /docs subpath using Cloudflare Workers"
55

66
import SubpathGatingSnippet from "/snippets/custom-subpath-gating.mdx";
77

8-
<SubpathGatingSnippet />
8+
<SubpathGatingSnippet platform="Cloudflare" />
99

1010
## Create Cloudflare Worker
1111

@@ -77,16 +77,8 @@ async function handleRequest(request) {
7777
// if no action found, play the regular request
7878
return await fetch(request);
7979
}
80-
81-
return await fetch(request);
8280
}
8381
```
8482

8583
Click on `Deploy` and wait for the changes to propagate (it can take up to a few
8684
hours).
87-
88-
## Reach out to Mintlify team
89-
90-
Once completing the Cloudflare setup, the Mintlify team will setup the
91-
subdirectory settings in your deployment. Reach out over
92-
[email](mailto:[email protected]).

advanced/subpath/route53-cloudfront.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: "Host documentation at a /docs subdirectory using AWS services"
55

66
import SubpathGatingSnippet from "/snippets/custom-subpath-gating.mdx";
77

8-
<SubpathGatingSnippet />
8+
<SubpathGatingSnippet platform="AWS Services" />
99

1010
## Create Cloudfront Distribution
1111

advanced/subpath/vercel.mdx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: "Vercel"
3+
description: "Host documentation at a /docs subpath using Vercel"
4+
---
5+
6+
import SubpathGatingSnippet from "/snippets/custom-subpath-gating.mdx";
7+
8+
<SubpathGatingSnippet platform="Vercel" />
9+
10+
## vercel.json Configuration
11+
12+
To host your documentation at a custom subpath using Vercel, you need to add the
13+
following configuration to your `vercel.json` file.
14+
15+
```json
16+
{
17+
"rewrites": [
18+
{
19+
"source": "/docs",
20+
"destination": "https://[subdomain].mintlify.dev/docs"
21+
},
22+
{
23+
"source": "/docs/:match*",
24+
"destination": "https://[subdomain].mintlify.dev/docs/:match*"
25+
}
26+
]
27+
}
28+
```
29+
30+
<Note>
31+
For more information, you can also refer to Vercel's offical guide on
32+
rewrites: [Project Configuration:
33+
Rewrites](https://vercel.com/docs/projects/project-configuration#rewrites)
34+
</Note>

advanced/user-auth/overview.mdx

Lines changed: 0 additions & 88 deletions
This file was deleted.

api-playground/openapi/setup.mdx

Lines changed: 72 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@ description: "Reference OpenAPI endpoints in your docs pages"
55

66
## Add an OpenAPI specification file
77

8-
To describe your endpoints with OpenAPI, make sure you have a valid OpenAPI document in either JSON or YAML format that follows the [OpenAPI specification](https://swagger.io/specification/). Your document must follow OpenAPI specification 3.0+.
8+
To describe your endpoints with OpenAPI, make sure you have a valid OpenAPI
9+
document in either JSON or YAML format that follows the
10+
[OpenAPI specification](https://swagger.io/specification/). Your document must
11+
follow OpenAPI specification 3.0+.
912

10-
## Autogenerating the API playground
13+
## Auto-populate API pages
1114

12-
You can either [autogenerate the API playground](/settings/navigation#tabs) or create MDX files for the individual OpenAPI endpoints.
13-
14-
### Auto-populate API pages
15-
16-
You can add an `openapi` field to an object in the `tabs` or `anchors` array in the `mint.json`. This can either be with OpenAPI documents that are in the docs repo (json or yaml) or hosted at a link.
15+
The fastest way to get started with OpenAPI is to add an `openapi` field to a tab or anchor in the `mint.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.
1716

1817
**Example with Anchors:**
1918

20-
```json
19+
```json {5}
2120
{
2221
"anchors": [
2322
{
@@ -34,7 +33,7 @@ You can add an `openapi` field to an object in the `tabs` or `anchors` array in
3433

3534
**Example with Tabs:**
3635

37-
```json
36+
```json {6}
3837
{
3938
"tabs": [
4039
{
@@ -48,85 +47,106 @@ You can add an `openapi` field to an object in the `tabs` or `anchors` array in
4847

4948
![](/images/autogeneration-with-tabs.png)
5049

51-
### Create MDX files for OpenAPI endpoints
50+
<Tip>To validate your OpenAPI spec, you can use this command: <br/>`mintlify openapi-check <openapiFilenameOrUrl>`</Tip>
51+
52+
53+
When using this option, the metadata for the generated pages will have the following default values:
54+
55+
* `title`: The `summary` field from the OpenAPI operation, if present. Otherwise a title generated from the HTTP method and endpoint.
56+
57+
* `description`: The `description` field from the OpenAPI operation, if present.
58+
59+
* `version`: The `version` value from the anchor or tab, if present.
60+
61+
There are some scenarios in which the default behavior isn't sufficient. If you need more customizability, you can create an MDX page for your OpenAPI operation, and modify it just like any other MDX page.
5262

53-
You can also create MDX files associated with each OpenAPI endpoint if you would like to add additional context to specific pages or have more granular control over the navigation. Here is [the code](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).
63+
## Create MDX files for API pages
64+
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).&#x20;
5466

5567
![](/images/elevenlabs-mdx-autogeneration-example.png)
5668

57-
If you want to autogenerate MDX files for every endpoint in your OpenAPI document you can use our scraper.
69+
### Autogenerate files
5870

59-
#### Autogenerate files
71+
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.
6072

61-
Our Mintlify [scraper](https://www.npmjs.com/package/@mintlify/scraping) autogenerates MDX files for your OpenAPI endpoints. Use the relative path to the OpenAPI document in your codebase. If you're using a publicly-hosted OpenAPI document, you can supply the URL in place of a path.
73+
Our Mintlify [scraper](https://www.npmjs.com/package/@mintlify/scraping)
74+
autogenerates MDX files for your OpenAPI endpoints. Use the relative path to the
75+
OpenAPI document in your codebase.
6276

6377
```bash
6478
npx @mintlify/scraping@latest openapi-file <path-to-openapi-file>
6579
```
6680

67-
68-
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.
81+
Add the `-o` flag to specify a folder to populate the files into. If a folder is
82+
not specified, the files will populate in the working directory.
6983

7084
```bash
7185
npx @mintlify/scraping@latest openapi-file <path-to-openapi-file> -o api-reference
7286
```
7387

7488
Learn more about our scraping package [here](https://www.npmjs.com/package/@mintlify/scraping).
7589

76-
The scraper will output an array of [Navigation entries](/settings/global#structure) containing your OpenAPI MDX files. You can either append these entries to your existing Navigation, or reorder and add the files to your navigation manually.
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.
7794

7895
<Note>
7996
If your OpenAPI document is invalid, the files will not autogenerate.
8097
</Note>
8198

82-
#### Manually specify files
99+
### Manually specify files
100+
101+
You can always create an MDX page manually, and reference the OpenAPI operation in the page's metadata using the `openapi` field.
83102

84103
<Snippet file="api-playground/openapi.mdx" />
85104

86-
By using the OpenAPI reference, the name, description, parameters, responses, and the API playground will be automatically generated using the specifications.
105+
By using the OpenAPI reference, the name, description, parameters, responses,
106+
and the API playground will be automatically generated from the OpenAPI document.
87107

88-
If you have multiple OpenAPI files, include the name of the OpenAPI file (without the file type `.json` or `.yaml`) to correctly map the information. This is not required if you have only one OpenAPI file - it will automatically detect your OpenAPI file.
108+
If you have multiple OpenAPI files, include the path to the OpenAPI file to ensure Mintlify finds the correct OpenAPI document. This is not required if you have
109+
only one OpenAPI file - it will automatically detect your OpenAPI file.
89110

90111
<CodeGroup>
91-
92-
```md Example
93-
---
94-
title: "Get users"
95-
openapi: "openapi-1 GET /users"
96-
---
97-
```
98-
99-
```md Format
100-
---
101-
title: "title of the page"
102-
openapi: openapi-file-name method endpoint
103-
---
104-
```
105-
112+
```md Example
113+
---
114+
title: "Get users"
115+
openapi: "/path/to/openapi-1.json GET /users"
116+
---
117+
```
118+
119+
```md Format
120+
---
121+
title: "title of the page"
122+
openapi: openapi-file-path method path
123+
---
124+
```
106125
</CodeGroup>
126+
107127
<br />
128+
108129
<Note>
109-
The method endpoint must match the endpoint specified in the OpenAPI
110-
specifications exactly. If the endpoint doesn't exist in the OpenAPI file,
130+
The method and path must match the method and path specified in the OpenAPI
131+
document exactly. If the endpoint doesn't exist in the OpenAPI file,
111132
the page will be empty.
112133
</Note>
113134

114135
## Create MDX files for OpenAPI schemas
115136

116-
Mintlify also allows you to create individual pages for any OpenAPI schema defined in an OpenAPI document's `components.schemas` field:
137+
Mintlify also allows you to create individual pages for any OpenAPI schema
138+
defined in an OpenAPI document's `components.schemas` field:
117139

118140
<CodeGroup>
119-
120-
```md Example
121-
---
122-
openapi-schema: OrderItem
123-
---
124-
```
125-
126-
```md Format
127-
---
128-
openapi-schema: "schema-key"
129-
---
130-
```
131-
132-
</CodeGroup>
141+
```md Example
142+
---
143+
openapi-schema: OrderItem
144+
---
145+
```
146+
147+
```md Format
148+
---
149+
openapi-schema: "schema-key"
150+
---
151+
```
152+
</CodeGroup>

0 commit comments

Comments
 (0)