Inconsistent Behavior of [] between version 1.7.0 and 1.8.3
See original GitHub issueConsider the following input:
{
"singleArray": [{"foo":"bar"}]
}
and JSONata expression:
singleArray[]
In version 1.7.0, the evaluated result is
[
{
"foo": "bar"
}
]
but in 1.8.3 it is
[
[
{
"foo": "bar"
}
]
]
Which evaluation is correct and why?
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Force nested arrays · Issue #399 · jsonata-js/jsonata - GitHub
on Jan 30, 2020. Maintain singleton sequence of array #405 ; on Jun 29, 2020. Inconsistent Behavior of [] between version 1.7.0 and...
Read more >htmlinput - Rocket Software Documentation
Script the Component Behavior · Define the Structure and Layout of Forms and Reports · Create the Component Layout of Server Pages.
Read more >dnf is inconsistent in how it treats weak dependencies across ...
Description of problem: On AArch64 and S390 we are unable to build software which uses ruby - all tests fail due to lack...
Read more >What's New - Chaos Vantage
Synchronized value defaults and ranges between Vantage UI and "Render animation via Live Link" dialog in 3Ds Max .
Read more >Digital Asset Manager Add-on Documentation - All release notes
Behavior has been updated to improve consistency in the way error messages ... [29229] Inconsistent display of Upload and Edit buttons between a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Shouldn’t changes like this trigger a major version increment, as it breaks applications expecting the previous behavior?
Just found this issue as I was expecting
$map
to always return an array. The docs for$map
says it returns an Array and doesn’t mention the singleton sequence case.I found the workaround was to add
[]
after the$map
function - this appears to ensure the result is always an array without causing the double nested array mentioned above: