question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Conversion to JSON with DataToDictionary().Convert() is not outputting the new GPS Coordinates data correctly

See original GitHub issue

I’m submitting a bug report about the GPS Coordinates getting encoded to JSON incorrectly when doing this ToSic.Sxc.Conversion.DataToDictionary(false).Convert(App.Data["Location"]);

[x] JS development [x] Content Types or data management [x] APIs like REST

Current behavior As you can see on line 15 of this output, the GPS coordinates are being encoded as a string with the quotes escaped. Compare that to line 24 and the output of the _2sxcEditInfo image

Expected behavior Though obviously we can code around it, I believe this is a bug and needs to be fixed so that the results at line 15 look like this with lattitude and longitude as numbers (not strings).

        "GPS": {
            "lattitude": 40.123123123,
            "logitude": -88.321321321
        }

Minimal reproduction of the problem with instructions Just output the 2sxc Content-App 11.03 Location content-type using .Convert() (see above) to JSON.

Please tell us about your environment: 2sxc 11.6.1 on DNN 9.07.02, 2sxc Content App is 11.03 from appx May 15.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jeremy-farrancecommented, Sep 28, 2020

Yes, because - you are right - some changes are light/minor. But in the two cases above, fields were added, deleted, and renamed. It’s also hard to answer because your implementation of ‘formula rules’ may also fall way short of my expectations. 😉

0reactions
iJungleboycommented, Oct 13, 2020

as of now, I don’t think we should or can quick-fix this, simply because it’s hard to guess what would break in the wild. Since the value is also a string in razor, requiring AsDynamic(item.GPS) to work as an object, we believe it should be clear what’s happening.

So we’ll leave it as is.

If somebody would like it to be optimized as pure json coming from the server, just create your own backend.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android convert Location model to json string
I have a problem with converting the Location model to JSON string. When I try to convert it With Gson to a string...
Read more >
Converting JSON data to GeoJSON data from an Arduino ...
So what needs to be done, is to have a Custom function which will query the streaming data, and then convert that to...
Read more >
ConvertTo-Json (Microsoft.PowerShell.Utility)
The ConvertTo-Json cmdlet converts any .NET object to a string in JavaScript Object Notation (JSON) format. The properties are converted to field names, ......
Read more >
Features To JSON (Conversion)—ArcGIS Pro | Documentation
ArcGIS geoprocessing tool that converts features to Esri JSON or GeoJSON format.
Read more >
how to convert Bridge GPS coordinates
But I just downloaded a image of the London Bridge and opened it in Photoshop and ran the script. A browser window opened...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found