JSON Formatter Class

In a 2015 blog post, @Paul_Lefebvre discusses some Xojo classes he created for formatting JSON, but sadly, the link there is broken. Anyone have these classes?

I need this because JSONitem.compact doesn’t work in 2021r2.1.

Hi Julia, the problem is that the blog has the URL as http and not https.

You may be able to download the code if you change the URL, here it is:
https://files.xojo.com/BlogExamples/FormatJSON.xojo_binary_project.zip

1 Like

I realize this is something of a “hack,” but could you simply use ParseJSON() and GenerateJSON()? For example:

Var jsonCompacted As String = GenerateJSON(ParseJSON( jsonInput ), False) 
Var jsonExpanded As String = GenerateJSON(ParseJSON( jsonInput ), True) 

Just throwing out ideas.

Thanks, @AlbertoD !

FYI, this is included with the Xojo examples:

5 Likes