how do I create a condition for parameter

1,613 views
Skip to first unread message

Spoon

unread,
Nov 18, 2015, 12:17:45 PM11/18/15
to Swagger
In the example (yml format) :
parameters:
        - name: location
          in: query
          description: Group.
          required: true
          type: string
          enum:
             - west
             - east
             - unkown
          format: double         
        - name: latitude
          in: query
          description: Latitude component of location.
          required: true
          type: number
          format: double
        - name: longitude
          in: query
          description: Longitude component of location.
          required: true
          type: number
          format: double

What I really would like is longitude & latitude are 'required' when 'location' is 'unkown' for exampel..
Is that do-able in 2.0 swagger definition ?


Ron

unread,
Dec 1, 2015, 3:33:41 PM12/1/15
to Swagger
Nope. There's no support for conditional parameters. See https://github.com/swagger-api/swagger-spec/issues/256.

Shiu Fun Poon

unread,
Dec 2, 2015, 9:00:14 PM12/2/15
to swagger-sw...@googlegroups.com
Ron,

Many thanks.  Too bad, it is not the answer I am looking for (it sure would be nice to have that kind of fine grained support)


--
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/84QrVgFIIgM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages