RyanMarcus / dirty-json

A parser for invalid JSON
GNU Affero General Public License v3.0
294 stars 30 forks source link

Parsing JSON fails on multidimensional array property #6

Closed tphamZerion closed 7 years ago

tphamZerion commented 7 years ago

When the server tried to parse an object contain a multidimensional array property, dirty-json sent out this message:

dirty-json got valid JSON that failed with the custom parser. We're returning the valid JSON, but please file a bug report here: https://github.com/RyanMarcus/dirty-json/issues

Here is my data: { "rows": [["this", "is", "failing"]] }

However, the parser works fine when the data has another array inside "rows" array. Here is an example: { "rows": [["it", "works", "fine"], ["now"]] }

Let me know if you need more information about the issue

Thank you :)

RyanMarcus commented 7 years ago

Confirmed this. Thanks for the report. I'll try to fix it soon.

RyanMarcus commented 7 years ago

Think I have a fix. Turns out it was a pretty simple bug.

tphamZerion commented 7 years ago

Thank you

RyanMarcus commented 7 years ago

Fixed in 0.4.0. On NPM now.