我正在使用在线Swagger Editor为我的 API 创建 Swagger 规范。
我的 API 有一个 GET 请求端点,我使用以下 YAML 代码来描述输入参数:
paths:
/fooBar:
get:
tags:
- foobar
summary: ''
description: ''
operationId: foobar
consumes:
- application/x-www-form-urlencoded
produces:
- application/json
parameters:
- name: address
in: query
description: Address to be foobared
required: true
type: string
example: 123, FakeStreet
- name: city
in: query
description: City of the Address
required: true
type: string
example: New York
如果我放入example
标签,我会收到一条错误消息:
不完全是 <#/definitions/parameter>,<#/definitions/jsonReference> 之一
在 Swagger 中编写 GET 参数时如何设置示例?