JamesMessinger / swagger-server

No longer maintained. Please use https://github.com/BigstickCarpet/swagger-express-middleware
MIT License
149 stars 47 forks source link

Nested Objects #12

Closed noecobian closed 8 years ago

noecobian commented 9 years ago

We're using swagger server and when using a get request we need as an example a data object which we are able to retrieve, and wth in it a cars array which will be built with the car definition, using

schema:
            type: object
            properties:
              data:
                type: array
                items:
                  $ref: "#/definitions/Car"

we retrieve a data array containing all the cars, but attempting to create:

data: {
           cars:[{
               carObjects........................
}]
}

i create the following which does not break, but not receiving the expected result.

schema:
            type: object
            properties:
              data:
                type: object
                properties:
                   cars:
                      type: array
                      items:
                         $ref: "#/definitions/Car"

With this we only receive a single car object, is this possible with swagger server?

JamesMessinger commented 8 years ago

I'm not sure I understand the problem. Can you post your Swagger API and the HTTP requests that you're sending?

JamesMessinger commented 8 years ago

Closing due to no response. Please re-open if this is still an issue