Home > OS >  jsonformatter showing Invalid json format
jsonformatter showing Invalid json format

Time:11-01

I am trying to send a json format in bloom but it's saying invalid json format.

    {
  "requestId": {
    'value': 'Hello'
  },
  "identifier": {
    'value': {
      'value': '3440869'
    },
    'refType': 1
  },
  "userInfo": {
    'customerStatus': 'CLOSED'
  }
}

It's giving me

Parse error on line 2:
..."requestId": {
    'value': 'Hello'

----------------------^
Expecting 'STRING', '}', got 'undefined'

CodePudding user response:

You need to replace all the single quotes with double quotes. It is then valid json.

{
    "requestId": {
        "value": "Hello"
    },
    "identifier": {
        "value": {
            "value": "3440869"
        },
        "refType": 1
    },
    "userInfo": {
        "customerStatus": "CLOSED"
    }
}

CodePudding user response:

You should replace ALL single quotes with double quotes,

You can verify your JSON format in any json editor, for example:

https://jsoneditoronline.org/

checking format with jsoneditoronline.org

here is the correct format:

{
  "requestId": {
    "value": "Hello"
  },
  "identifier": {
    "value": {
      "value": "3440869"
    },
    "refType": 1
  },
  "userInfo": {
    "customerStatus": "CLOSED"
  }
}
  •  Tags:  
  • json
  • Related