0
/api/create:
    post:
      summary: ---
      description: ----
      parameters:
        - in: formData
          name: products
          description: 'Array of key value pairs'
          required: true
          type: array
          items:
            type: object
            properties:
              id: 
                type: string

This is giving error enter image description here

My goal is to accept input as an array of object.Something like [{id:"sdsd"},{id:"dd"}]

Rajan Lagah
  • 2,373
  • 1
  • 24
  • 40
  • Does your API expect JSON (`application/json`, like in your example in the last paragraph) or form data (`application/x-www-form-urlencoded` or `multipart/form-data`)? – Helen Mar 09 '23 at 14:29
  • @Helen `application/json`. I think it's because of formData – Rajan Lagah Mar 09 '23 at 15:23
  • 1
    _"I think it's because of formData"_ - yes, you need to use an `in: body` parameter instead - see the [linked Q&A](https://stackoverflow.com/q/19585581/113116). – Helen Mar 09 '23 at 15:33

0 Answers0