How to remove the “Examples” combobox or change its text in Swagger UI?

社会主义新天地 提交于 2019-12-01 12:54:49

问题


I have a problem with Swagger UI where it displays an empty "Examples" combobox (marked yellow on the image below) which does not look good. Is there a way to remove it or change its text to something useful?

I tried adding the example tag, but it won't work. The operation definition looks like this:

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

回答1:


It was a bug in Swagger UI v. 3.23.0-3.23.1 (and Swagger Editor 3.6.31) that was fixed in v. 3.23.2.



来源:https://stackoverflow.com/questions/56984536/how-to-remove-the-examples-combobox-or-change-its-text-in-swagger-ui

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!