bhall2001 / fastjson

A Livecode library for JSON encoding and decoding to and from Arrays.
MIT License
17 stars 11 forks source link

Numbers starting with 0 should be converted to a string #8

Closed bhall2001 closed 8 years ago

bhall2001 commented 8 years ago

JSONlint does not like numbers that start with 0. Need to convert all numbers that start with a 0 to a string.

madpink commented 8 years ago

are you referring to a leading "0" like this: 05543 or are you referring to a decimal that is less than "0" like this: 0.33345 ?

bhall2001 commented 8 years ago

It's the first example that is causing lint to throw an exception. The 2nd is legal JSON but the first is not. The funny thing is the JSON data that I'm using from an Application I have written is for Dog competition (without going into details). Dogs are assigned a once in a lifetime UUID that is YYMMDDXXX by a national organization. My test file has some dogs who registered prior to 2010 that cause lint to the error. Real numbers are total legal but integers beginning with 0 are not valid.

I have this one almost fixed. In final testing now.