The first part validated correctly and the second part validated correctly
so I modified as follows and the complete string validated correctly.

While this now validates if you have not pasted the entire string that may
be why this change worked.

I don't know JSON but the repeating section I think needs to be enclosed
in [ ] not { }

{
"userName": "BERT ",
"userAge": 28,
"userWeight": 180,
"userGender": "M",
"userHeight": "72",
"mID": "GB",

"workoutDate": {
"Month": 2,
"Day": 22,
"Year": 2016
},
"distance": 10.1,
"finishTime": {
"Hours": 13,
"Minutes": 38
},
"pctAverageHeartRateInZone": 0.0,
"averageSpeed": 15.1,
"totalWorkoutTime": {
"Hours": 0,
"Minutes": 40
},
"averageWattsPerHour": 75.0,
"totalCalories": 211.0,
"avgHeartRate": 129.3,
"avgRpm": 62,
"avgLevel": 4
}


Don Brown





From: Jon Paris <jon.paris@xxxxxxxxxxxxxx>
To: "Web400@Midrange. Com" <web400@xxxxxxxxxxxx>
Date: 13/03/2017 07:03 AM
Subject: [WEB400] JSON Syntax error
Sent by: "WEB400" <web400-bounces@xxxxxxxxxxxx>



The JSON below is an extract from a file produced by an exercise bike. It
has a syntax error apparently but I'm danged if I can see what it is -
admittedly I'm shaky on JSON so it is probably something obvious but ...

The array/collection/whatever that begins with as "workoutDate" is the
part of the file that repeats. I've tried various minor corrections on the
assumption that the error has to be trivial but without success.

{
"userName": "BERT ",
"userAge": 28,
"userWeight": 180,
"userGender": "M",
"userHeight": "72",
"mID": "GB"
} {
"workoutDate": {
"Month": 2,
"Day": 22,
"Year": 2016
},
"distance": 10.1,
"finishTime": {
"Hours": 13,
"Minutes": 38
},
"pctAverageHeartRateInZone": 0.0,
"averageSpeed": 15.1,
"totalWorkoutTime": {
"Hours": 0,
"Minutes": 40
},
"averageWattsPerHour": 75.0,
"totalCalories": 211.0,
"avgHeartRate": 129.3,
"avgRpm": 62,
"avgLevel": 4
}

Can somebody spot what the problem is here.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.