is there a way to document enum values in 2.0 ?

1,084 views
Skip to first unread message

chandler

unread,
Mar 23, 2015, 7:38:16 PM3/23/15
to swagger-sw...@googlegroups.com
Is there a mechanism to document individual enum values in Swagger 2.0. 
For example,  I have

  UserType:
    type: string
    description: User Type
    enum:
      - viewer 
      - admin
  
What I'd like to do is add text (other than via comments) to each of the enum values so it shows up in documentation. Possible ? Feature request ?

Ron Ratovsky

unread,
Mar 26, 2015, 12:53:35 PM3/26/15
to swagger-sw...@googlegroups.com
While it makes sense, currently it is not possible to do directly as JSON Schema doesn't allow it. You'd have to use the description field to manually describe each enum value.

However, feel free to open a feature request on the swagger-spec repository and we'll see if and how we can provide a solution for it in a future version of the spec.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------
Reply all
Reply to author
Forward
0 new messages