我想definitions
在查询字符串中使用定义的枚举作为我的参数定义的一部分。
我在definitions
我的 Swagger 2.0 规范文件的一部分中定义了 Swagger Enum。
OperationType:
type: string
enum:
- registration
- renewal
我可以在其他定义中创建对它的引用:
Operation:
type: object
properties:
name:
type: string
type:
$ref: '#/definitions/OperationType'
我可以在参数为 时使用schema
标签来引用它in: body
,但在参数为 时则不行in: query
- name: operation
in: body
description: description
schema:
$ref: '#/definitions/OperationType'
我尝试删除schema:
并进行参考enum:
,但无法使其正常工作。