Specify an array of strings as body parameter in swagger API

Your description of an array of string is correct, but the parameter definition misses the name property to be valid.

Here’s a full working example:

swagger: "2.0"

info:
  title: A dummy title
  version: 1.0.0

paths:
  /path:
    post:
      parameters:
        - in: body
          description: xxx
          required: true
          name: a name
          schema:
            type: array
            items:
              type: string
      responses:
        default:
          description: OK

Try the online editor to check your OpenAPI (fka. Swagger) specs: http://editor.swagger.io/

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)