Rama Krishnam
Rama Krishnam

Reputation: 73

JSON Validation error Expecting 'EOF', '}', ',', ']', got ':'

I am working on a JSON rest API and the below payload is giving me a validation error. I am unable to find the issue. What could be the issue?

Parse error on line 11:
...      "fq":[   "AA":"123140372859067",
----------------------^
Expecting 'EOF', '}', ',', ']', got ':'

JSON:

{
    "responseHeader": {
        "zkConnected":"true",
        "status":0,
        "QTime":6,
        "params": {
            "q":"*:*",
            "start":"0",
            "json":"",
            "fq": [
                "AA":"123140372859067",
                "BB":"123140*",
                "CC":"*41*"
            ],
            "rows":"10",
            "forwardedCount":"1",
            "wt":"json"
        }
    }
}

Upvotes: 0

Views: 59

Answers (1)

Andrew H
Andrew H

Reputation: 931

JSON arrays cannot contain properties. You need to change "fq" to be an object, or remove the property keys:

"responseHeader":{
  "zkConnected":"true",
  "status":0,
  "QTime":6,
  "params":{
    "q":"*:*",
    "start":"0",
    "json":"",
    "fq":{
      "AA":"123140372859067",
      "BB":"123140*",
      "CC":"*41*"
    },
    "rows":"10",
    "forwardedCount":"1",
    "wt":"json"
  }
}

Upvotes: 1

Related Questions