Skip to content

file upload schema error 400 #47

@nbalduzzi

Description

@nbalduzzi

Hi, when i define the schema consumer in endpoint /upload to 'multipart/form-data' for uploading file i dont know wich is the schema structure body for passing the base64 string or the file that i need to upload.

If y define the schema:

schema: {
      description: 'Upload file',
      tags: ['Info'],
      consumes: [ 'multipart/form-data' ],
      summary: 'Upload the file to the server',
      body: {
        type: 'object',
        properties: {
          file: {type: 'string'}
        }
      },
      response: {
        200: {
          description: 'Succesful response',
          type: 'boolean'
        }
      }
    }

when i send the post get the error:

{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "body should be object"
}

I fetch in the dynamic.js code looking for the solution but i dont get with it.

Can you help me?

PD: Im sorry if this is not the place for this kind of issues.

Thx

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions