Hi Jon
I haven't read all the responses but I can see with the naked eye that this is not a JSON. JSON requires name:value pairs where each value is a simple string, number, array or object. If your workout data is a repeating subset of data associated with the user then it would be like this:
{
"userName": "BERT ",
"userAge": 28,
"userWeight": 180,
"userGender": "M",
"userHeight": "72",
"mID": "GB",
"data": [
{
"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
}
]
}
So "data" becomes an array (repeater) of workout statistics
Cheers
Kevin
[
https://www.netcracker.com/assets/img/netcracker-social-final.png] ƕ
-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Jon Paris
Sent: 12 March 2017 21:03
To: Web400@Midrange. Com <web400@xxxxxxxxxxxx>
Subject: [WEB400] JSON Syntax error
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
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/web400.
________________________________
The information transmitted herein is intended only for the person or entity to which it is addressed and may contain confidential, proprietary and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
As an Amazon Associate we earn from qualifying purchases.