skyscreamer / JSONassert

Write JSON unit tests in less code. Great for testing REST interfaces.
http://jsonassert.skyscreamer.org
Apache License 2.0
992 stars 197 forks source link

Should consider the JSON to be invalid when adding a "," after a closing object tag in an array of objects #127

Open AElMehdi opened 3 years ago

AElMehdi commented 3 years ago

The following example should be considered as an invalid JSON, yet it passes and is seen as if we have 2 values in the array.

   "id": 1,
   "props": [
      {
         "id": 1,
         "propB": true
      },
   ],
   "propC": false
} 

It returns the following error: java.lang.AssertionError: props[]: Expected 1 values but got 2

It can be linked to the following issue.

Lu-Jichen commented 3 years ago

I would like to try to work on this issue.

Crayon-new commented 3 years ago

@AElMehdi I think it is caused by the first character is "\"". So this json lib will parse it as JSONString. Maybe I will solve this bug.

AElMehdi commented 3 years ago

@Crayon-new Cool! Have fun! :)

ChuXiyes commented 3 years ago

I would like to work on this issue