Forum Discussion

cobain2004's avatar
cobain2004
Regular Visitor
7 months ago

OpenApi Mulitpart formdata request single array definition

Hi,

 

is there a way to define inside a multipart/form-data request an array as json within openapi?

i.e. [{"xyz": ""}, {"xyz": ""}] without a name for the array

 

i.e.

type: array
    items:
       type: object
       properties:
        xyz:

        type: string

 

creates a non json array. whereas

 

type: object

properties:

   listXyz:

      type:array

      items:

          type: object

          properties:

               xyz:

               type: string

 

creates an array with name:

listXyz=[{"xyz": ""}, {"xyz": ""}]

 

Unfortunately I did not find any solution.

i.e. on https://swagger.io/docs/specification/describing-request-body/multipart-requests/

No RepliesBe the first to reply