Skip to content

Commit 5bf79d4

Browse files
authored
Update Swagger documentation to use V3 (#1188)
Docs are currently showing examples using both Swagger V2 and V3 (swagger_context vs openapi_context). Changing examples to V3 by default (which is the version set by default) would make the documentation more consistant and avoid version mistakes for new users.
1 parent e3dae2b commit 5bf79d4

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

core/swagger.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class Product // The class name will be used to name exposed resources
154154
*
155155
* @ApiProperty(
156156
* attributes={
157-
* "swagger_context"={"type"="string", "format"="date-time"}
157+
* "openapi_context"={"type"="string", "format"="date-time"}
158158
* }
159159
* )
160160
*/
@@ -171,13 +171,13 @@ resources:
171171
properties:
172172
name:
173173
attributes:
174-
swagger_context:
174+
openapi_context:
175175
type: string
176176
enum: ['one', 'two']
177177
example: one
178178
timestamp:
179179
attributes:
180-
swagger_context:
180+
openapi_context:
181181
type: string
182182
format: date-time
183183
```
@@ -190,7 +190,7 @@ resources:
190190
https://api-platform.com/schema/metadata/metadata-2.0.xsd">
191191
<resource class="App\Entity\Product">
192192
<property name="name">
193-
<attribute name="swagger_context">
193+
<attribute name="openapi_context">
194194
<attribute name="type">type</attribute>
195195
<attribute name="enum">
196196
<attribute>one</attribute>
@@ -200,7 +200,7 @@ resources:
200200
</attribute>
201201
</property>
202202
<property name="timestamp">
203-
<attribute name="swagger_context">
203+
<attribute name="openapi_context">
204204
<attribute name="type">string</attribute>
205205
<attribute name="format">date-time</attribute>
206206
</attribute>
@@ -301,8 +301,8 @@ resources:
301301
method: get
302302
path: '/rabbit/rand'
303303
controller: App\Controller\RandomRabbit
304-
# if you are using OpenApi V3 use 'openapi_context' instead of 'swagger_context'
305-
swagger_context:
304+
# if you are using OpenApi V2 instead of V3 use 'swagger_context' instead of 'openapi_context'
305+
openapi_context:
306306
summary: Random rabbit picture
307307
description: >
308308
# Pop a great rabbit picture by color!
@@ -334,8 +334,8 @@ resources:
334334
<attribute name="method">get</attribute>
335335
<attribute name="path">/rabbit/rand</attribute>
336336
<attribute name="controller">App\Controller\RandomRabbit</attribute>
337-
<!-- if you are using OpenApi V3 use 'openapi_context' instead of 'swagger_context' -->
338-
<attribute name="swagger_context">
337+
<!-- if you are using OpenApi V2 instead of V3 use 'swagger_context' instead of 'openapi_context' -->
338+
<attribute name="openapi_context">
339339
<attribute name="summary">Random rabbit picture</attribute>
340340
<attribute name="description">
341341
# Pop a great rabbit picture by color!

0 commit comments

Comments
 (0)