I have a REST services to document, some of them accepts simple array like:
[
{ \"name\":\"a\" },
{ \"name\":\"b\" },
{ \"name\":\"c\" }
]
I tried the follwoing in the editor.swagger.io, it satisfies the request of this question and works. The POST request body expects an array. The array is composed of 'stackoverflow' items. Each item is an object, that has name property.
paths:
/test:
post:
summary: test 123
description: test 123
parameters:
- name: param1
in: body
required: true
description: test param1
schema:
type: array
items:
$ref: '#/definitions/stackoverflow'
responses:
200:
description: OK
definitions:
stackoverflow:
type: object
properties:
name:
type: string
description: name of the object