Contact(ENG,GER): unrealmarketplace@virtualbird.de

Plugin is located, after the installation via the launcher, in the directory: Engine\Plugins\Marketplace
If you use the Unreal GIT version you have to copy the plugin into your project: D:\myproject\Plugins\JSONParser


Check your JSON string on this website first.
This makes it easier to understand which Blueprint nodes you need to use. The right side is similar to my plugin.
Start your project and check plugins.




Let's start with a simple example.


We parse the json string to get a json object. The json object is a struct variable.
Then we check whether this has worked and, as is typical for blueprints, we make a break on the struct variable.


The plugin is divided into two main data structures. Maps and Arrays. Maps can be recognized by the {} bracket and arrays by the [] bracket.
As you can see from lines 1 and 2 in the JSON string, we have no arrays in the example.

In line 2 we have “name”: “John Doe”. The key of the map is therefore name and the value is John Doe.
Since John Doe is bracketed in quotation marks, it must be a string.
In line 3 we see a number without quotation marks. In other words, a number map.
Finally, we see a false without quotation marks, i.e. a bool map. This is how we read the values:


Other direction. Let's create this json string.


Now let's try a nested json string.


As you can see in line 4, the value starts with a { bracket. This means that it is a json object that can contain values again.
This is how we get the street name:


Now the other way around but only with the street name.


Now an example with an array.


You can see from the [] brackets that the value of MyNumbers is an array.
An array is also a json object in this plugin. So we first get the json object via the map and can then use the array contained there.


An array containing further json objects.




A json string that starts directly with an array.




There are also async functions. In these, parsing takes place outside the game thread. Only makes sense with large json strings.
With small ones, the overhead can cause it to take longer. You can also work directly with files.




It is possible to convert stucts to JSON and back since Plugin version 2.0.
Important!
Do not use spaces in variable names. Unreal removes these during the build process and then your names no longer match your JSON.
Object references are not supported. References are only addresses in RAM. Saving them makes no sense because they change every time the app is started.
You could try to read and serialize the data behind the addresses and then create a new reference with the data when deserializing.
But since this is not possible for every object and also very error-prone I do not want to have this function in the plugin.
Please do not try to save (large) files in the byte array. Each byte is an array element. With a 1 megabyte file you have 1 million array elements! This would take several minutes or lead directly to a crash. Convert the bytes into a string using the Base64 function and save this.



Since version 2.4 it is possible to compress data. You can choose between Zlib, Gzip and LZ4. Gzip requires at least UE4.26. All popular programming languages like Java, C#, Javascript should support at least one of these formats.


For decompressing the original byte size is needed!






Here are a few older examples































Contact(ENG,GER): unrealmarketplace@virtualbird.de