docusaurus-openapi-docs
docusaurus-openapi-docs copied to clipboard
Missing boundary in Content-Type when multipart/form-data
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
- Go to https://docs.nabla.com/server/copilot-listen-from-file
- (you don't care about having a working api key or even about specifying correct values for the rest of the fields)
- Drag & drop a random file, and inspect the network request it makes.
- The request body is multi-part and has a boundary but it's not specified in the content-type header.
Screenshots
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
:tada: Thanks for opening your first issue here! Welcome to the community!
Hi @AchrafAmil, did #625 address your issue?
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:
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.
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
Hi @AchrafAmil can you test again using 2.0.1? Thanks!
Now it's working, wow awesome, thanks a lot! 🎉
(I'll let you decide if we can already close this issue, etc)
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: