I’m afraid there’s no clear way to do that in 2.0, because you choose to 
represent your array in a javascript/json format even though you can’t really 
define mime types to non-body parameters.

In 3.0 there’s a well defined method of describing it, but it’s not out yet.

 

 

 

From: <swagger-swaggersocket@googlegroups.com> on behalf of Taylor Ice 
<icet...@gmail.com>
Reply-To: "swagger-swaggersocket@googlegroups.com" 
<swagger-swaggersocket@googlegroups.com>
Date: Thursday, 13 October 2016 at 11:10
To: Swagger <swagger-swaggersocket@googlegroups.com>
Subject: Multidimensional Integer Array

 

I am trying to get a 2D array with pairs of integers, however, whenever I am 
sending the information from the swagger editor, I am getting a single array 
comprised of single element arrays inside of it. 

 

An example of the output is: [[1], [2], [3], [4]]

 

The result that I am looking for is: [[1,2], [3,4]]

 

  /distribution/{distribution}:

    get:

      tags:

      - "RNG"

      summary: "Returns a random value from a weighted distribution"

      description: "This will return a random value from the weighted 
distribution"

      operationId: "distribution"

      parameters:

      - name: "distribution"

        in: "path"

        description: "2D array that represents the weighted distribution"

        required: true

        type: "array"

        items:
          type: "array"
          items:

            type: "integer"

            format: "int32"

      responses:

        200:

          description: "Distribution"

          schema:

            $ref: "#/definitions/Distribution"

        default:

          description: "Unexpected error"

          schema:

            $ref: "#/definitions/Error"

      x-swagger-router-controller: "RNG"


I am on swagger 2.0 and using Javascript with node.js.

 

Any help would be greatly appreciated.

-- 
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-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to