Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multipart/form-data missing boundary #37

Open
tfilo opened this issue Sep 23, 2022 · 0 comments
Open

multipart/form-data missing boundary #37

tfilo opened this issue Sep 23, 2022 · 0 comments

Comments

@tfilo
Copy link

tfilo commented Sep 23, 2022

Hello, i have following openapi specification and trying to generate api using @openapi-generator-plus/typescript-fetch-client-generator": "^1.4.0" :

"requestBody": {
     "content": {
        "multipart/form-data": {
            "schema": {
                 "type": "object",
                 "required": ["file"],
                "properties": {
                    "file": {
                         "type": "string",
                        "format": "binary"
                   }
                }
              }
          }
       },
       "required": true
   },
}

When I am uploading picture, i have problem to process it with multer in node.js. I get error Multipart: Boundary not found and when I inspect request in browser, there is header with following content type:
content-type: multipart/form-data

but when I comment out line localVarHeaderParameter.set('Content-Type', 'multipart/form-data'); in generated api.ts than browser add automatically correct header:

Content-Type: multipart/form-data; boundary=---------------------------100249134216970869883614643436

Is it possible somehow force this openapi generator to not include problematic line with localVarHeaderParameter.set('Content-Type', 'multipart/form-data'); or somehow fix to to include boundary information too ?

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant