Swagger Enumerations in YAML

Recently, I have been spending time looking at the Swagger 2.0 Specification.  There XML representation and Enumerations are tricky.  Here is an example of a Swagger Enumeration in YAML.

You can test the YAML https://gist.githubusercontent.com/prb112/59b9cb4ad3d2df19911c/raw/7db2a16b353d8dde5bb3743001f46f7b67b6c431/enumeration.yaml at http://petstore.swagger.io/#!/default/get_demo

 

Swagger with Enumeration
Swagger with Enumeration

 

Join the Conversation

4 Comments

  1. Can we have re-usable enums ? i.e Enums defined at a placed and reuse them ?

    1. I personally have used them in the model. You should be able to reference them in a parameter

Leave a comment

Leave a Reply to Pradeep Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.