That is the conclusion I was coming to Kevin.

I can only guess that the tool the company make available on their web site manipulates the uploaded fine in some way before processing it. Why anyone would use son-like syntax but not do it "right" is a mystery. Scott's comment about it being data from a Schwinn exercise bike is spot on. Different model but basically the same.

I'll ask Scott to send me his code and then also try to see how readily I can make the manual changes according to your layout.

Many thanks to all who replied.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Mar 13, 2017, at 4:41 AM, Kevin Turner <kevin.turner@xxxxxxxxxxxxxx> wrote:

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.
--
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.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.