这是indexloc提供的服务,不要输入任何密码
Skip to content

Regression: Multiline JSON arrays no longer parsed correctly in .bru files body:json (since v2.8) #5173

@maximeLyt

Description

@maximeLyt

I have checked the following:

  • I have searched existing issues and found nothing related to my issue.

This bug is:

  • making Bruno unusable for me
  • slowing me down but I'm able to continue working
  • annoying
  • this feature was working in a previous version but is broken in the current release.

Bruno version

2.8.0

Operating System

Ubuntu 22.04.5 LTS

Jira

Describe the bug

Since version 2.8.0, Bruno no longer accepts multiline JSON arrays in .bru files.
JSON that includes line breaks inside arrays (which was previously working) now causes parsing errors.

This issue occurs when running requests via the CLI using bru run.
The same files worked fine in version 2.7.x.

Examples

✅ This works:

["foo", "bar"]

✅ This also works:

[{"foo": "bar"}]
[{
  "foo": "bar"
}]

❌ This fails:

[
  "foo",
  "bar"
]

❌ This also fails:

[
  {
    "foo": "bar"
  }
]

Expected Behavior
Multiline JSON arrays (with valid syntax) should be parsed correctly, as they are valid JSON.
This was the case in previous versions and should remain supported for readability and maintainability.

Actual Behavior
Parsing error is thrown in Bruno for any multiline JSON array or object inside arrays.

Workaround
Minify the JSON manually to remove line breaks

["foo", "bar"]

.bru file to reproduce the bug

demo.txt

Screenshots/Live demo link

with @usebruno/cli@2.7.0
Image

with @usebruno/cli@2.8.0

Image

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