Skip to content

invalid json file validated since v4.40.2 #2351

Open
@sda399

Description

@sda399

Describe the bug
hi folks
invalid json is parsed and fixed by yq, this breaks file validation tests based on yq

Version of yq: 4.40.2
Operating system: linux
Installed via: github binary

Input Json

{
  "hello": "value"
  "foo": "bar"
}

Command

for V in 4.35.1 4.40.2; do
  curl -L --silent --output /tmp/yq "https://github.com/mikefarah/yq/releases/download/v$V/yq_linux_amd64"
  chmod +x /tmp/yq
  echo "==="
  /tmp/yq --version
  echo '{"hello": "value"\n "foo": "bar"}' | /tmp/yq -e -pj -oj
  rm /tmp/yq
done

Actual behavior

{
  "hello": "value",
  "foo": "bar"
}

Expected behavior
expected an error on parsing

Error: bad file '-': invalid character '"' after object key:value pair

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions