If you go to http://editor.swagger.io and open the full_petstore.yaml example, you can search for any ‘body’ parameter and that will show you what Tony was talking about.
From: <[email protected]> on behalf of Mathieu Pheulpin <[email protected]> Reply-To: "[email protected]" <[email protected]> Date: Thursday, 22 September 2016 at 8:17 To: Swagger <[email protected]> Subject: Re: Array of objects as an input parameter Could you please show an example of what you're describing? Thanks On Wednesday, September 21, 2016 at 7:42:54 PM UTC-7, tony tam wrote: You don't want formData, you want an object, with attribute "sources" which is type "array". On Sep 21, 2016, at 6:50 PM, Mathieu Pheulpin <[email protected]> wrote: I'm trying to describe the following post parameter in swagger: { "sources": [ { "id": 101, "parentId": 201 },{ "id": 102, "parentId": 201 },{ "id": 102, "parentId": 202 } ], "destinationId": 301, "param1": "value 1", "param2": "value 2", } The issue is that the sources is an array of objects, that swagger does not seem to support. Ideally I'd like something like that: paths: /bulk-action: post: parameters: - name: sources in: formData type: array enum: $ref: '#/definitions/BulkSource' - name: destinationId in: formData type: integer - name: param1 in: formData type: string - name: param2 in: formData type: string definitions: BulkSource: type: object properties: id: type: integer parentId: type: integer Any idea on how to work around this limitation? Thanks -- 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 [email protected]. 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 [email protected]. 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
