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

Missing boundary in Content-Type when multipart/form-data #633

Open
AchrafAmil opened this issue Oct 5, 2023 · 7 comments
Open

Missing boundary in Content-Type when multipart/form-data #633

AchrafAmil opened this issue Oct 5, 2023 · 7 comments
Assignees
Labels
bug Something isn't working reviewing 👀 Undergoing manual audit to determine if issue should still be active

Comments

@AchrafAmil
Copy link

Describe the bug

The interactive Prism console for upload endpoint doesn't seem to make the right call for endpoints with content-type multipart/form-data

Expected behavior

Expects the call made from the console to specify a boundary
(otherwise the server receiving the request fails with a legit java.io.IOException: Failed to parse multipart: Content-Type's boundary parameter is missing).

Current behavior

The request it makes when hitting the "send api request" seems malformatted.

Possible solution

Specify the boundary, e.g. content-type: multipart/form-data; boundary=------WebKitFormBoundaryF6sSRjfPR0gJB7xK

Steps to reproduce

  1. Go to https://docs.nabla.com/server/copilot-listen-from-file
  2. (you don't care about having a working api key or even about specifying correct values for the rest of the fields)
  3. Drag & drop a random file, and inspect the network request it makes.
  4. The request body is multi-part and has a boundary but it's not specified in the content-type header.

Screenshots

image

Untitled

Your Environment

  • Version used:
    "@asyncapi/generator": "^1.10.9",
    "@docusaurus/core": "^2.4.1",
    "@docusaurus/preset-classic": "^2.4.1",
    "@mdx-js/react": "^1.6.22",
    "clsx": "^1.1.1",
    "docusaurus-plugin-openapi-docs": "^2.0.0-beta.3",
    "docusaurus-theme-openapi-docs": "^2.0.0-beta.3",
    "prism-react-renderer": "^1.3.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "html-loader": "^4.2.0"
  • Environment name and version Chrome 117.0.5938.92 arm64
  • Operating System and version: macOS Ventura 13.3.1
  • Link to your project: docs.nabla.com
@AchrafAmil AchrafAmil added the bug Something isn't working label Oct 5, 2023
@welcome-to-palo-alto-networks
Copy link

🎉 Thanks for opening your first issue here! Welcome to the community!

@sserrata
Copy link
Member

Hi @AchrafAmil, did #625 address your issue?

@AchrafAmil
Copy link
Author

Thanks for sharing, I didn't know about #625.
Just upgraded to beta-4 to have it and it seems to fix the boundary issue:
image

But it now doesn't include the json string item in the FormData (request_parameters).

As you can see in the screenshot the body doesn't include the request_parameters as it used to in the beta3.

image

@AchrafAmil
Copy link
Author

Tested with the new stable 2.0.0:

    "@docusaurus/core": "^2.4.3",
    "@docusaurus/preset-classic": "^2.4.3",
    "docusaurus-plugin-openapi-docs": "^2.0.0",
    "docusaurus-theme-openapi-docs": "^2.0.0",

and I'm still facing the same problem as my previous comment (it does not include the json string item in the FormData).

@sserrata let me know if you need any more details on this

@sserrata
Copy link
Member

sserrata commented Dec 1, 2023

Hi @AchrafAmil can you test again using 2.0.1? Thanks!

@AchrafAmil
Copy link
Author

Now it's working, wow awesome, thanks a lot! 🎉

(I'll let you decide if we can already close this issue, etc)

@AchrafAmil
Copy link
Author

Though, now that I succeed in uploading a file I start hitting the 5 secs timeout pretty easily...
Is there any way to override the timeout other than the hardcode swizzle from #327 and #351 ? 🙏

Because doing an eject swizzle for ApiExplorer/Request breaks my docs:
image
image

@blindaa121 blindaa121 self-assigned this Apr 1, 2024
@blindaa121 blindaa121 added the reviewing 👀 Undergoing manual audit to determine if issue should still be active label Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working reviewing 👀 Undergoing manual audit to determine if issue should still be active
Projects
None yet
Development

No branches or pull requests

3 participants