如何使用swagger.yml创建一个字段不同于其值的枚举?
例如,使用以下字段生成枚举:
ON(“ 1”), OFF(“ 0”);
代替:
ON(“ ON”), OFF(“ OFF”);
答案 0 :(得分:0)
要了解如何将枚举添加到swagger.yml
swagger: swagger version
info:
title: Enum added to yml
version: "swagger version of your application"
host: dulaj.kulathunga
schemes:
- https
basePath: /1
produces:
- application/atom+xml
paths:
/demo:
get:
summary: enum added to yml samples
description: |
enum added to yml samples
parameters:
- name: switch_status
in: query
description: switech preperties
required: true
type: string
enum:
- On
- Off
responses:
200:
description: The response upon succesful query
default:
description: Error occured