Skip to content

Instantly share code, notes, and snippets.

@prb112
Created September 4, 2015 00:30
Show Gist options
  • Save prb112/59b9cb4ad3d2df19911c to your computer and use it in GitHub Desktop.
Save prb112/59b9cb4ad3d2df19911c to your computer and use it in GitHub Desktop.
Example of a Swagger Enumeration in YAML
#YAML Demonstration
swagger: '2.0'
info:
title: Demonstration of Swagger Yaml with Enumeration
description: Simple Demonstration of Enumeration
version: "1.0.0"
host: api.bastide.org
schemes:
- https
basePath: /1
produces:
- application/atom+xml
paths:
/demo:
get:
summary: demonstration for enumeration
description: |
Demonstrates an enumeration
parameters:
- name: day
in: query
description: day of the week
required: true
type: string
enum:
- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- Saturday
- Sunday
responses:
200:
description: The response upon succesful query
default:
description: Error occured
@AaronFeng2014
Copy link

how to define enum, just like this (int, string)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment