File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,26 @@ It is also possible to use OpenAPI v3.0.0 format:
50
50
bin/console api:openapi:export --spec-version=3.0.0
51
51
```
52
52
53
+ ## Create several versions of a specification
54
+
55
+ You can now decline a same OpenAPI specification in multiple versions using the ` x-apiplatform-tags ` tag:
56
+
57
+ ``` php
58
+ use ApiPlatform\OpenApi\Factory\OpenApiFactory;
59
+
60
+ #[GetCollection(openapi: new Operation(extensionProperties: [OpenApiFactory::API_PLATFORM_TAG => ['customer', 'developer']]))]
61
+ #[Post(openapi: new Operation(extensionProperties: [OpenApiFactory::API_PLATFORM_TAG => 'developer']))]
62
+ class Book {}
63
+ ```
64
+
65
+ Then, either use the query parameter for the web version such as ` /docs?filter_tags[]=customer ` or through the command line:
66
+
67
+ ```
68
+ bin/console api:openapi:export --filter-tags=customer
69
+ ```
70
+
71
+ To produce a specification including only the operation matching your tag.
72
+
53
73
## Overriding the OpenAPI Specification
54
74
55
75
### Overriding the OpenAPI Specification with Symfony
You can’t perform that action at this time.
0 commit comments