how to document swagger query parameter with json object input

250 views
Skip to first unread message

Parag Baxi

unread,
Jul 13, 2016, 5:58:43 PM7/13/16
to Swagger
Tried SO first.

How do I define a JSON object value for a request parameter that is in: query (not in: body)?

Example below:

paths:
  /schedules:
    get:
      summary: Gets the list of schedules
      description: |
        The schedules endpoint returns information about the configured schedules.
      parameters:
        - name: filter
          in: query
          description: >
          Returns whether alert runs on matching schedule.


          Example request:


              {
                "type": "a",
                "start" : "b",
                "stop" : "c"
              }
          required: true
          type: string

Because it's not in: body, I cannot use schema.


tony tam

unread,
Jul 13, 2016, 6:03:59 PM7/13/16
to <swagger-swaggersocket@googlegroups.com>
Yes, this is not supported in the 2.0 Swagger specification.  It will be in the 3.0 Open API spec but for now, your only option is to use a string.

--
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.

Reply all
Reply to author
Forward
0 new messages