繁体   English   中英

如何在 Swagger UI 中删除“示例”组合框或更改其文本?

[英]How to remove the "Examples" combobox or change its text in Swagger UI?

我有一个 Swagger UI 的问题,它显示一个空的“示例”组合框(下图中标记为黄色),看起来不太好。 有没有办法删除它或将其文本更改为有用的内容?

Swagger 3.0 Petstore 示例

我尝试添加example标签,但它不起作用。 操作定义如下所示:

post:
  tags:
  - pet
  summary: Add a new pet to the store
  operationId: addPet
  requestBody:
    description: Pet object that needs to be added to the store
    content:
      application/json:
        schema:
          $ref: '#/components/schemas/Pet'
      application/xml:
        schema:
          $ref: '#/components/schemas/Pet'
    required: true
  responses:
    405:
      description: Invalid input
      content: {}
  security:
  - petstore_auth:
    - write:pets
    - read:pets

这是Swagger UI v. 3.23.0-3.23.1(和 Swagger Editor 3.6.31)中的一个错误,已在 v. 3.23.2 中修复

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM