File Upload with settings

16 views
Skip to first unread message

Betül Altay

unread,
Jan 11, 2018, 2:27:08 AM1/11/18
to Swagger
Hello,

I'm using Swagger editor and trying to create a post in order to upload a file. I succeeded to send a file with a string :)

However, I want to send more settings (an object) with it. As yaml file below, I handle it by stringifying an object but I think it is not clean way. I wonder that is there any better solution?

/File/CSV/:
    post:
      description:upload csv file
      operationId: uploadCSV
      consumes:
        - multipart/form-data
      produces:
        - application/json
      parameters:
        - name: file
          in: formData
          description: file to upload
          type: file
          minLength: 0
          maxLength: 500000000  # ~500MB
        - name: importFileSettings
          in: formData
          type: string
          description: stringified version of a ImportFileSettings so application must unwrap this string !!!!!!! HERE
      responses:
        '200':
          description: Successful response
          schema:
            $ref: '#/definitions/Response'
Reply all
Reply to author
Forward
0 new messages