@@ -234,6 +234,8 @@ class User
234
234
235
235
You also have full control over both built-in and custom operations documentation:
236
236
237
+ In Yaml:
238
+
237
239
``` yaml
238
240
resources :
239
241
App\Entity\Rabbit :
@@ -262,6 +264,54 @@ resources:
262
264
description : Pink rabbit
263
265
` ` `
264
266
267
+ or with XML:
268
+
269
+ ` ` ` xml
270
+ <?xml version="1.0" encoding="UTF-8" ?>
271
+ <resources xmlns="https://api-platform.com/schema/metadata"
272
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
273
+ xsi:schemaLocation="https://api-platform.com/schema/metadata
274
+ https://api-platform.com/schema/metadata/metadata-2.0.xsd">
275
+ <resource class="App\Entity\Rabbit">
276
+ <collectionOperations>
277
+ <collectionOperation name="create_user">
278
+ <attribute name="method">get</attribute>
279
+ <attribute name="path">/rabbit/rand</attribute>
280
+ <attribute name="controller">App\Controller\RandomRabbit</attribute>
281
+ <attribute name="swagger_context">
282
+ <attribute name="summary">Random rabbit picture</attribute>
283
+ <attribute name="description">
284
+ # Pop a great rabbit picture by color!
285
+
286
+ 
287
+ </attribute>
288
+ <attribute name="parameters">
289
+ <attribute>
290
+ <attribute name="in">body</attribute>
291
+ <attribute name="schema">
292
+ <attribute name="type">object</attribute>
293
+ <attribute name="properties">
294
+ <attribute name="name">
295
+ <attribute name="type">string</attribute>
296
+ </attribute>
297
+ <attribute name="description">
298
+ <attribute name="type">string</attribute>
299
+ </attribute>
300
+ </attribute>
301
+ </attribute>
302
+ <attribute name="example">
303
+ <attribute name="name">Rabbit</attribute>
304
+ <attribute name="description">Pink rabbit</attribute>
305
+ </attribute>
306
+ </attribute>
307
+ </attribute>
308
+ </attribute>
309
+ </collectionOperation>
310
+ </collectionOperations>
311
+ </resource>
312
+ </resources>
313
+ ```
314
+
265
315
![ Impact on swagger ui] ( ../distribution/images/swagger-ui-2.png )
266
316
267
317
## Changing the Swagger UI Location
0 commit comments