I would like to use an enum defined in definitions
as part of my parameter definitions in a query string.
I'm defining the Swagger Enum in the definitions
part of my Swagger 2.0 spec file.
OperationType:
type: string
enum:
- registration
- renewal
I can create references to it in other definitions:
Operation:
type: object
properties:
name:
type: string
type:
$ref: '#/definitions/OperationType'
I can use the schema
tag to make a reference to it when the parameter is in: body
, but not when it's in: query
- name: operation
in: body
description: description
schema:
$ref: '#/definitions/OperationType'
I tried dropping schema:
and making a reference in enum:
instead, but can't get it to work.