当我将示例添加到我的 swagger 文档中并在 swagger 编辑器上测试它时,它永远不会显示在任何地方。有人能给我一个例子,说明多个示例实际上在任何地方显示吗?
Here is an example of how multiple examples are added:
它来自:https://swagger.io/docs/specification/adding-examples/
这是一个不显示任何 yaml 的示例examples
在在线 swagger 编辑器上:
openapi: 3.0.0
info:
title: Some API
version: 1.0.0
paths:
/logon:
get:
summary: Login user
tags:
- '/logon'
parameters:
- name: Client
in: query
required: true
examples:
zero:
value: '0'
summary: A sample limit value
max:
value: '50'
summary: A sample limit value
schema:
type: string
responses:
'200':
description: Success response
多种的examples
显示在 Swagger UI 3.23.0+ 和 Swagger Editor 3.6.21+ 中:
在旧版本中,您可以使用单个example
作为解决方法:
parameters:
- name: Client
in: query
required: true
example: '50' # <-----
schema:
type: string
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)