EasyJsonParser

A plugin that allows intuitive access to JSON data using dot notation.

Overview

EasyJsonParser is a plugin that simplifies JSON processing in Unreal Engine. It features an elegant dot notation access system, making it intuitive and easy to work with complex data structures.

Even developers with limited programming experience can easily parse and utilize JSON data using this plugin.

Key Features

  • Simple access to JSON data using dot notation
  • Support for complex nested JSON structures
  • Easy access to array elements
  • Full support for both C++ and Blueprint
  • Fast and efficient parsing

Usage Examples

After loading a JSON string or a JSON file, you can retrieve values by specifying an access string.

GALLERY 1

Specifying an access string

Specify the path to the desired value by connecting keys with dots.

Simple case

The access string to retrieve the “prop” value from the following simple JSON is prop.

{
  "prop":"abc"
}

In the case of an object with a hierarchical structure

In the case of a hierarchical structure as shown below, create the access string by connecting keys with dots.
In the following example, to retrieve the prop property of the obj object, the access string is obj.prop.

{
  "obj":
  {
    "prop":"abc"
  }
}

In the case where arrays are included

Copilot said: For arrays like the example below, specify

For arrays like the example below, specify which array element to use by its index.
For example, to retrieve the property of the second element, use obj[1].prop.
To retrieve the property of the first element, use obj[0].prop.

{
  "obj":[
    {
      "prop":"abc"
    },
    {
      "prop":"def"
    }
  ]
}

Retrieving values by type

The following four functions are provided to retrieve values from a JSON object.

pic
  • ReadInt(int)
  • ReadFloat(float)
  • ReadString(string)
  • ReadBool(bool)

Enter the access string in “AccessString” and the default value in “DefaultValue”.

If the specified value does not exist in the JSON, the default value will be returned.

Retrieve an object

There are also “ReadObject” and “ReadObjects” methods that allow you to retrieve objects instead of values.

These methods can only be used with properties of object type.

ReadObject retrieves a single node object.

ReadObjects retrieves an array of multiple objects.

As shown in the figure below, these methods can be used to obtain an object located in the middle of the hierarchy, and then access its properties.

pic

FAQ

You can check frequently asked questions here.