Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading