Skip to content

Commit c305293

Browse files
Add manual endpoint navigation example to MDX setup guide (#1921)
* Update api-playground/mdx-setup.mdx * Update api-playground/mdx-setup.mdx * Update api-playground/mdx-setup.mdx --------- Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> Co-authored-by: Ethan Palm <[email protected]>
1 parent d89b3ca commit c305293

File tree

1 file changed

+69
-1
lines changed

1 file changed

+69
-1
lines changed

api-playground/mdx-setup.mdx

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,75 @@ You can manually define API endpoints in individual MDX pages. This approach is
9595
```
9696
</Step>
9797
<Step title="Add your endpoints to your docs">
98-
Add your endpoint pages to the navigation by updating the `pages` field in your `docs.json`. Learn more about structuring your docs in [Navigation](/organize/navigation).
98+
Add your endpoint pages to the navigation by updating the `pages` field in your `docs.json`:
99+
100+
```json docs.json
101+
"navigation": {
102+
"tabs": [
103+
{
104+
"tab": "API Reference",
105+
"groups": [
106+
{
107+
"group": "Users",
108+
"pages": [
109+
"api-reference/users/create-user",
110+
"api-reference/users/get-user",
111+
"api-reference/users/update-user"
112+
]
113+
},
114+
{
115+
"group": "Orders",
116+
"pages": [
117+
"api-reference/orders/create-order",
118+
"api-reference/orders/list-orders"
119+
]
120+
}
121+
]
122+
}
123+
]
124+
}
125+
```
126+
127+
Each page path corresponds to an MDX file in your docs repository. For example, `api-reference/users/create-user.mdx`. Learn more about structuring your docs in [Navigation](/organize/navigation).
128+
129+
### Using OpenAPI endpoints in navigation
130+
131+
If you have an OpenAPI specification, you can reference endpoints directly in your navigation without creating individual MDX files. Reference specific endpoints by including the OpenAPI file path and the endpoint:
132+
133+
```json docs.json
134+
"navigation": {
135+
"pages": [
136+
"introduction",
137+
"/path/to/users-openapi.json POST /users",
138+
"/path/to/orders-openapi.json GET /orders"
139+
]
140+
}
141+
```
142+
143+
You can also set a default OpenAPI spec for a navigation group and reference endpoints by method and path:
144+
145+
```json docs.json
146+
{
147+
"group": "API reference",
148+
"openapi": "/path/to/openapi-v1.json",
149+
"pages": [
150+
"overview",
151+
"authentication",
152+
"GET /users",
153+
"POST /users",
154+
{
155+
"group": "Orders",
156+
"openapi": "/path/to/openapi-v2.json",
157+
"pages": [
158+
"GET /orders",
159+
"POST /orders"
160+
]
161+
}
162+
]
163+
}
164+
```
165+
166+
For more details on OpenAPI integration, see [OpenAPI setup](/api-playground/openapi-setup).
99167
</Step>
100168
</Steps>
101169

0 commit comments

Comments
 (0)