why this object is not parsed correctly? (help wanted!!!)
See original GitHub issueHi, i’m trying to stringify
and parse
this object
but i’m keep getting the wrong result…
every this newFiltes[0].filters[0/1].value.value
should be array of strings, it’s always transforming this array to
{0: 'string', 1: 'string'}
no matter what i pass to arrayLimit
…
hope i’m not missing something here.
thanks.
https://codesandbox.io/s/musing-alex-l8i2h7?file=/src/App.js
{
newFilters: [
{
id: 0,
filters: [
{
value: {
value: [1660424400000, 1661115599999],
operator:
"eyJuYW1lIjoiX2FuZCIsInR5cGUiOiJtYXRjaCIsImxhYmVsIjoiRHVyaW5nIiwiY29tcG9uZW50cyI6WyJleUp1WVcxbElqb2lYMmQwWlNJc0lteGhZbVZzSWpvaVIzSmxZWFJsY2lCMGFHRnVJR1Z4ZFdGc0luMD0iLCJleUp1WVcxbElqb2lYMngwWlNJc0lteGhZbVZzSWpvaVRHVnpjeUIwYUdGdUlHVnhkV0ZzSW4wPSJdfQ=="
},
name: "date",
type: "date",
isDefault: true
},
{
value: {
value: ["60071434"],
operator: "eyJuYW1lIjoiX2luIiwibGFiZWwiOiJNYXRjaCBhbnkifQ=="
},
name: "accounts",
type: "accounts"
}
],
conjunction: "and"
}
]
}
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Why is this JSON not being parsed correctly? - Stack Overflow
It's because there are line breaks in your strings. If you view the source of the JSON page, you can see them all....
Read more >SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
What went wrong? JSON. parse() parses a string as JSON. This string has to be valid JSON and will throw this error if...
Read more >Solved: Flow - Parse JSON Dynamic Content not showing in O...
Flow is driving me crazy with this issue. I have a flow (which runs successfully) that includes a "Parse JSON" and "Send an...
Read more >Error while parsing JSON Response in REST API Post call
When I invoke the same REST method through the UI, it is raising a parsing error.
Read more >Parse nested JSON object? - Zapier Community
How can we access nested JSON object elements in a Zapier Webhook? I tried with javascript and json.parser and that's not work for...
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 FreeTop 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
Top GitHub Comments
not relevant because I’m saving the data in a different structure now, so the new structure works fine. I assumed that probably I have a typo somewhere and it’s not a bug in
qs
. BTW, I’m trying to add thearrayFormat: indices
, but it’s still not working…still going to transform the
value.value
arrays into objects https://codesandbox.io/s/restless-meadow-3zbxi8?file=/src/App.jsI see what you mean: https://codesandbox.io/s/bitter-cloud-1jc73n?file=/src/App.js it round trips to a string correctly, but not to the initial nested array. This is definitely worth fixing.