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: core/swagger.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -225,6 +225,32 @@ class User
225
225
}
226
226
```
227
227
228
+
## Changing Operations in the Swagger Documentation
229
+
230
+
You also have full control over both built-in and custom operations documentation:
231
+
232
+
```yaml
233
+
resources:
234
+
App\Entity\Rabbit:
235
+
collectionOperations:
236
+
create_user:
237
+
method: get
238
+
path: '/rabbit/rand'
239
+
controller: App\Controller\RandomRabbit
240
+
swagger_context:
241
+
summary: Random rabbit picture
242
+
description: >
243
+
# Pop a great rabbit picture by color!
244
+
245
+

246
+
247
+
requestBody: '{"days": 23}'
248
+
parameters:
249
+
- {name: 'theme', description: 'dark'}
250
+
```
251
+
252
+

253
+
228
254
## Changing the Swagger UI Location
229
255
230
256
Sometimes you may want to have the API at one location, and the Swagger UI at a different location. This can be done by disabling the Swagger UI from the API Platform configuration file and manually adding the Swagger UI controller.
0 commit comments