JSON validation pending "EOF"

I am working on a calm api and checking out http://jsonlint.com/ . After combining two JSON objects, I came across

Parse error on line 932:
...ssions": 329    }],[    {        "m
---------------------^
Expecting 'EOF'

I looked around and found this question, but all the answers indicate the absence of a comma, where in my problem I have a comma. What else can a validator look for?

it points to code between my object arrays;

],
[
+4
source share
3 answers

You haven't shown enough of your JSON, but I assume it looks like this:

[
    {"some": "object"},
    {"some": "object"}
],
[
    {"some": "object"},
    {"some": "object"}
]

... which is invalid. JSON must have one top-level element (which in the full JSON document must be either an object or an array).

, -, :

{
    "response1": [
        {"some": "object"},
        {"some": "object"}
    ],
    "response2": [
        {"some": "object"},
        {"some": "object"}
    ]
}
+17

, JSON . JSON, :

    String o1 = JSON1;
    String o2 = JSON2;
    String[] jsonArray = {o1, o2};
    return Arrays.deepToString(jsonArray);
0

I'm not an expert on multi-user JSON structures. But here's what I did. Just changed the encoding of the stream to UTF-8, and my PHP code started to work very well.

0
source

Source: https://habr.com/ru/post/1529840/


All Articles