Uploaded image for project: 'Lucee Development'
  1. LDEV-1146

deSerializeJSON fail to parse a negative float value


    • Type: Bug
    • Status: Deployed
    • Priority: New
    • Resolution: Fixed
    • Affects Version/s:
    • Fix Version/s:
    • Labels:
    • Sprint:


      comment copy from LDEV-1126 Deployed

      Lyle Karstensen:
      There is still an issue with this. If the json packet has a float field with a negative value like a longitude you get an error parsing the json.
      sample value -115.155258178711

      bdw429s Brad Wood added a comment - 2 hours ago
      Lyle Karstensen Can you show some actual sample code and tell us the exact version of Lucee 5 you tested with. This code here works fine for me:

      writeDump( deSerializeJSON( '{ "foo" : -115.155258178711 }' ) );

      Lyle Karstensen added a comment - 1 hour ago
      I was using version and got the issue since version had the fix. The issue is when you do query of an SQL Server database that has a float column and then serialize it then try to deserialize it.

      <cfquery name="querywithfloat">
      select floatfield
      from atable
      json = SerializeJSON(querywithfloat);
      query = DeserializeJSON(json, false);

      I am working with Micha on another project and emailed him the exact json with real data in it (I don't want that on this page). But wanted to note this here for reference.

      Lyle Karstensen added a comment - 1 hour ago - edited
      These are the fields from the Serialized Query and exact data. I was able to replicate the issue by selecting the LON column and then not selecting it

      writeDump( deSerializeJSON( '{"COLUMNS":["LAT","LON"],"DATA":[[36.145317077637,-115.27172088623]]}', false);

      Unfortunately I cannot test this on my servers because version crashes my test site because of this issue.




            • Assignee:
              michaeloffner Michael Offner
              michaeloffner Michael Offner
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: