File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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:
5050bin/console api:openapi:export --spec-version=3.0.0
5151```
5252
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+
5373## Overriding the OpenAPI Specification
5474
5575### Overriding the OpenAPI Specification with Symfony
You can’t perform that action at this time.
0 commit comments