Skip to content

Commit 867dad9

Browse files
committed
update x-hidden docs and include other label
1 parent 883d97d commit 867dad9

File tree

1 file changed

+34
-13
lines changed

1 file changed

+34
-13
lines changed

api-playground/openapi/advanced-features.mdx

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,40 +136,61 @@ paths:
136136
planter.list({ potted: true });
137137
```
138138

139-
## `x-hidden`
139+
## `x-hidden` and `x-excluded`
140140

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`.
142142

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.
144146

145147
Here's are examples of how that would look in an OpenAPI schema document for an endpoint or a webhook path:
146148

147-
```json {14}
149+
```json {11, 19}
148150
"paths": {
149151
"/plants": {
150152
"get": {
151153
"description": "Returns all plants from the store",
152154
"parameters": { ... },
153-
"responses": { ... },
155+
"responses": { ... }
154156
}
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+
},
156166
"/secret_plants": {
157167
"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!)",
159170
"parameters": { ... },
160-
"responses": { ... },
161-
"x-hidden": true
171+
"responses": { ... }
162172
}
163173
}
164174
},
165175
```
166176

167-
```json {5}
177+
```json {9, 15}
168178
"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": {
170191
"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!)"
173194
}
174195
}
175196
}

0 commit comments

Comments
 (0)