Can someone format this .json data to the correct .json format without errors?Ill buy you coffee for a whole week if you can

{"requestTime": '2023-11-20T00:00:00.000Z',                                   
"propertyPrices": {
"arrivalDatePrices": [{
"startDate": {
"year": 2023
"month": 11
"day": 10
}
"endDate": {
"year": 2023
"month": 11
"day": 12
}
"productPrices": [{
"roomTypeId": "158143"
"ratePlanId": "158143"
"occupancyPrices": [{
"adults": 2
"prices": [{
"rateRuleId": "mobile,desktop"
"currencyCode": "USD"
"rates": [160.95,160.95,...]
"taxes": [28.734,28.735,...]
}]
}]
}]
}]
}
}        

I tried adding commas, and paranthesis where the error mentioned in this .json formatter at the following link:https://jsonlint.com/

however, the .json data entered into the .json formatter does not validate

>Solution :

I’ve added commas after the values in the objects, fixed the missing commas between key-value pairs, and corrected the string value for the "requestTime" key to use double quotes instead of single quotes.

{
  "requestTime": "2023-11-20T00:00:00.000Z",
  "propertyPrices": {
    "arrivalDatePrices": [
      {
        "startDate": {
          "year": 2023,
          "month": 11,
          "day": 10
        },
        "endDate": {
          "year": 2023,
          "month": 11,
          "day": 12
        },
        "productPrices": [
          {
            "roomTypeId": "158143",
            "ratePlanId": "158143",
            "occupancyPrices": [
              {
                "adults": 2,
                "prices": [
                  {
                    "rateRuleId": "mobile,desktop",
                    "currencyCode": "USD",
                    "rates": [160.95, 160.95],
                    "taxes": [28.734, 28.735]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}

Leave a Reply