api 平台文档使用 swagger 3 时无法添加摘要
can't add summary when using swagger 3 for api platform documentation
我想使用 swagger 3 为我的 API 平台添加文档。
我的 api 配置文件:
api_platform:
# The title of the API.
title: 'API title'
# The description of the API.
description: 'API description'
# The version of the API.
version: '0.0.0'
mapping:
paths: ['%kernel.project_dir%/src/Entity']
patch_formats:
json: ['application/merge-patch+json']
swagger:
versions: [3]
collection:
pagination:
enabled: false
items_per_page : 20
client_enabled: true
client_items_per_page: true
items_per_page_parameter_name: "count"
eager_loading:
enabled: false
在我的实体中,我添加了 itemOperations 并尝试添加摘要:
itemOperations={
* "get"={"method"="GET"},
* "put"={"method"="PUT"},
* "delete"={"method"="DELETE"},
* "increment"={
* "method"="post",
* "path"="/invoices/{id}/increment",
* "controller"="App\Controller\InvoiceIncrementationController",
* "swagger_context"={
* "summary"="my text" // <<<<<-------- want to add a text
* }
* }
* },
我无法添加文本,但是当我将 swagger 版本降级为 2 时,我得到了我的文本。
如何为 swagger 3 添加摘要?
对于 swagger v3 swagger_context
使用 openapi_context
我想使用 swagger 3 为我的 API 平台添加文档。 我的 api 配置文件:
api_platform:
# The title of the API.
title: 'API title'
# The description of the API.
description: 'API description'
# The version of the API.
version: '0.0.0'
mapping:
paths: ['%kernel.project_dir%/src/Entity']
patch_formats:
json: ['application/merge-patch+json']
swagger:
versions: [3]
collection:
pagination:
enabled: false
items_per_page : 20
client_enabled: true
client_items_per_page: true
items_per_page_parameter_name: "count"
eager_loading:
enabled: false
在我的实体中,我添加了 itemOperations 并尝试添加摘要:
itemOperations={
* "get"={"method"="GET"},
* "put"={"method"="PUT"},
* "delete"={"method"="DELETE"},
* "increment"={
* "method"="post",
* "path"="/invoices/{id}/increment",
* "controller"="App\Controller\InvoiceIncrementationController",
* "swagger_context"={
* "summary"="my text" // <<<<<-------- want to add a text
* }
* }
* },
我无法添加文本,但是当我将 swagger 版本降级为 2 时,我得到了我的文本。
如何为 swagger 3 添加摘要?
对于 swagger v3 swagger_context
使用 openapi_context