簡體   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