首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用swagger 3 for api platform文档时无法添加摘要

使用swagger 3 for api platform文档时无法添加摘要
EN

Stack Overflow用户
提问于 2020-03-05 17:32:43
回答 1查看 112关注 0票数 1

我想使用swagger 3为我的API平台添加一个文档。我的api配置文件:

代码语言:javascript
复制
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,并尝试添加摘要:

代码语言:javascript
复制
 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添加摘要?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-03-05 22:23:24

对于swagger v3而不是swagger_context,使用openapi_context

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60542065

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档