Forum Discussion

surangamas's avatar
surangamas
New Contributor
3 years ago

Adding descriptions to enum values

HI everyone, just wondering whether there is a way to add descriptions to enum values, by enum values, I am referring to this: https://swagger.io/docs/specification/data-models/enums/

 

For example, consider the following enum values: 

  1. enum:
  2. - black
  3. - white
  4. - red
  5. - green
  1. - blue

My question is, can we do something like this: 

 

  1. enum:
  2. - black:
  3.    description: color is black
  4. - white:
  5.   description: color is black
  6. ...

I validated the above in both Postman and Swagger editor, and they passed the validation, but I just want to know if this is the right way to do it? 

No RepliesBe the first to reply