Error while parsing valid json
See original GitHub issueFirst of all, thank you for this tool it is very helpful.
I was trying to encode this value:
[{"holder1": {"type1": [["value1", "value2"], ["value1", "value2"]]}}]
And it resulted in this error:
5:15: expected ';', found '[' (and 1 more errors)
The smallest structure that still shows the error is the following.
[{"holder1": {"type1": [["value"]]}}]
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
JSON.parse error on a seemingly valid JSON [duplicate]
The error is a result of data being an object, not JSON. You don't need to parse anything; it is already a JavaScript...
Read more >How to handle invalid JSON parse error properly.
The most common way to handle JSON parse error is using try-catch block. If the JSON string is valid, it will return a...
Read more >SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
JSON.parse() parses a string as JSON. This string has to be valid JSON and will throw this error if incorrect syntax was encountered....
Read more >What Is JSON and How to Handle an “Unexpected Token” Error
Learn what JSON is and how you can deal with errors occurring when parsing JSON data, such as "Unexpected Token < in JSON...
Read more >Solved: Error while parsing JSON: 'Unexpected character en...
Hi there,. I have a flow created that uses SQL connector to connect to a database view and pulls records from there and...
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
Hi Matt, I will look into it this weekend!
The issue does not seem to be caused by
gofmt
but rather the output ofjsonToGo()
is invalid Gostruct
. There is an extraneousType1
in the output when the function is called withflatten = true
, see here: https://play.golang.org/p/tpFHAOmFQk8So this is probably a bug. I may be able to look into it further when I have the time.