Closed hhanquez closed 2 months ago
Still present on v1.12.3. This bug bit me after importing a big collection from Insomnia :-S
Example body:
meta {
name: Test
type: http
seq: 7
}
post {
url: {{host}}/api/test
body: multipartForm
auth: none
}
headers {
Accept: application/json, text/plain, */*
Content-Type: application/json
}
body:multipart-form {
city: {
"name": "Test",
"description": "Test"
}
}
Hi, a workaround could be to minify your JSON so it fits on a single line (worked for me).
This bug has been fixed #2086. Please try the latest version of Bruno!
Sorry @sanjai0py but I still have the issue on version 1.18.0
This is a test file:
meta {
name: Test of issue 1692
type: http
seq: 3
}
post {
url: https://www.test.com
body: multipartForm
auth: none
}
body:multipart-form {
body: {
"label": "json",
"foo": "bar"
}
file: @file(/home/myplace/Images/gif/OuEmkXe.gif)
}
The file is not loaded and I see this in the logs:
(node:242998) UnhandledPromiseRejectionWarning: Error: Line 17, col 6:
16 | "foo": "bar"
> 17 | }
^
18 | file: @file(/home/myplace/Images/gif/OuEmkXe.gif)
Expected ":"
at parser (/opt/Bruno/resources/app.asar/node_modules/@usebruno/lang/v2/src/bruToJson.js:592:11)
at bruToJson (/opt/Bruno/resources/app.asar/src/bru/index.js:94:18)
at add (/opt/Bruno/resources/app.asar/src/app/watcher.js:249:19)
at FSWatcher.<anonymous> (/opt/Bruno/resources/app.asar/src/app/watcher.js:548:34)
at FSWatcher.emit (node:events:527:28)
at FSWatcher.emitWithAll (/opt/Bruno/resources/app.asar/node_modules/chokidar/index.js:540:8)
at FSWatcher._emit (/opt/Bruno/resources/app.asar/node_modules/chokidar/index.js:632:8)
at NodeFsHandler._handleFile (/opt/Bruno/resources/app.asar/node_modules/chokidar/lib/nodefs-handler.js:400:14)
at NodeFsHandler._addToNodeFs (/opt/Bruno/resources/app.asar/node_modules/chokidar/lib/nodefs-handler.js:637:21)
(Use `bruno --trace-warnings ...` to show where the warning was created)
(node:242998) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
Hi @hhanquez the PR #2407 with the fix has been merged. The next outgoing release will fix your problem.
Closing this issue has been fixed. Thank you for taking the time to report the bug, everyone!
I'm writing requests containing multipart/form with json and files
When bruno is loading the collection, the bru file is not loaded as the body can't be parsed
Exemple of body:
Error in console:
Tested on versions 1.9.0 and 1.10.0