我想使用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添加摘要?
发布于 2020-03-05 22:23:24
对于swagger v3而不是swagger_context,使用openapi_context
https://stackoverflow.com/questions/60542065
复制相似问题