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/advanced-features.mdx
+34-13Lines changed: 34 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,40 +136,61 @@ paths:
136
136
planter.list({ potted: true });
137
137
```
138
138
139
-
## `x-hidden`
139
+
## `x-hidden` and `x-excluded`
140
140
141
-
If your pages are [autogenerated](/api-playground/openapi/setup) from an OpenAPI document, but there are some paths that you don't want to create pages for, you can hide them by adding the property `x-hidden`.
141
+
If your pages are [autogenerated](/api-playground/openapi/setup) from an OpenAPI document, but there are some paths that you don't want to create pages for, you can exclude them from having pages generated by adding the property `x-excluded`.
142
142
143
-
You can add the `x-hidden` tag under endpoint or webhook paths below the method.
143
+
If you want to have pages generated, but not have them appear in the navigation, add `x-hidden`.
144
+
145
+
You can add the `x-hidden` or `x-excluded` tag under endpoint or webhook paths below the method.
144
146
145
147
Here's are examples of how that would look in an OpenAPI schema document for an endpoint or a webhook path:
146
148
147
-
```json {14}
149
+
```json {11, 19}
148
150
"paths": {
149
151
"/plants": {
150
152
"get": {
151
153
"description": "Returns all plants from the store",
152
154
"parameters": { ... },
153
-
"responses": { ... },
155
+
"responses": { ... }
154
156
}
155
-
}
157
+
},
158
+
"/hidden_plants": {
159
+
"get": {
160
+
"x-hidden": true,
161
+
"description": "Returns all somewhat secret plants from the store",
162
+
"parameters": { ... },
163
+
"responses": { ... }
164
+
}
165
+
},
156
166
"/secret_plants": {
157
167
"get": {
158
-
"description": "Returns all secret plants from the store (do not publish this endpoint!)",
168
+
"x-excluded": true,
169
+
"description": "Returns all top secret plants from the store (do not publish this endpoint!)",
159
170
"parameters": { ... },
160
-
"responses": { ... },
161
-
"x-hidden": true
171
+
"responses": { ... }
162
172
}
163
173
}
164
174
},
165
175
```
166
176
167
-
```json {5}
177
+
```json {9, 15}
168
178
"webhooks": {
169
-
"/secret_pants_hook": {
179
+
"/plants_hook": {
180
+
"post": {
181
+
"description": "Webhook for information about a new plant added to the store",
182
+
}
183
+
},
184
+
"/hidden_plants_hook": {
185
+
"post": {
186
+
"x-hidden": true,
187
+
"description": "Webhook for somewhat secret information about a new plant added to the store"
188
+
}
189
+
},
190
+
"/secret_plants_hook": {
170
191
"post": {
171
-
"description": "Secret webhook for information about a new plant added to the store",
172
-
"x-hidden": true
192
+
"x-excluded": true,
193
+
"description": "Webhook for top secret information about a new plant added to the store (do not publish this endpoint!)"
0 commit comments