Problem with JSON, Detail is : Passed JSON string is not valid

0 votes

[
Hi

 

I am trying to store a json that looks like this one: 

  [
        "origin:6",
        "destination:7",
        {
            "attacker": [
                4,
                2,
                1
            ],
            "defender": [
                6,
                2
            ]
        }
    ],
    [
        "origin:5",
        "destination:4",
        {
            "attacker": [
                2
            ],
            "defender": [
                5,
                3
            ]
        }
    ],
    [
        "origin:3",
        "destination:2",
        {
            "attacker": [
                3
            ],
            "defender": [
                6,
                3
            ]
        }
    ],
    [
        "player:1"
    ]
]

And I am getting this error :

Message is : Bad Request
App Error code is : 2605
 Http Error code is 400
 Detail is : Passed JSON string is not valid

I validate the json at JSONLint.com . I also tried to have unique names for every object by only sending one of the iterations. Still the same problem. 

Is there any limitation? is there something wrong with my json that the json validator does not detect?

 

 

asked Feb 1, 2015 in App42 Cloud API-BaaS by Sebastián Galiano (10 points)
recategorized Mar 3, 2015 by sushil

1 Answer

0 votes

Hello Sebastian,

We just copy & pasted your complete json in pro.jsonlint.com & its invalid json. Also we would like to tell you that, we don't provide Array insert in Storage service. You can create insert your json in the for json string or json object to insert the data.

Also find a correct json below:

{
    "userdata": [
        "origin:6",
        "destination:7",
        {
            "attacker": [
                4,
                2,
                1
            ],
            "defender": [
                6,
                2
            ]
        },
        [
            "origin:5",
            "destination:4",
            {
                "attacker": [
                    2
                ],
                "defender": [
                    5,
                    3
                ]
            }
        ],
        [
            "origin:3",
            "destination:2",
            {
                "attacker": [
                    3
                ],
                "defender": [
                    6,
                    3
                ]
            }
        ],
        [
            "player:1"
        ]
    ]
}

Please make the changes according & let us know if you need further assistance regarding this.

Himanshu Sharma

answered Feb 2, 2015 by hs00105 (2,005 points)
edited Feb 2, 2015 by hs00105
Thanks. Problem solved :)
Hello Sebastian,

Good to hear that your query has been resolved. Let us know if you have more questions for us.

Thanks,
HImanshu Sharma
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...