How to use ObjectDeliveryBoxUsingJson
In Version 1.5.0 or later, the Json serialization format of UObject can be selected from the following two types.
- Do not include the class name (conventional format)
{
"Prop": 1
}
- Include class name
{
"Type": "SampleClassName",
"Body":
{
"Prop": 1
}
}
With the conventional method, there was no class name in the JSON, so multiple classes could not be handled.
By including the class name in json, multiple types can be serialized and deserialized in one DeliveryBox. Even if you have an object as a property of the type of the base class, the information will not be lost.
But the class name is saved for each object, so the number of characters (data size) of json increases.
Select serialization method
I will explain in the case of serialization of the blueprint below

- The class name of this blueprint is
CustomObject1 - Has a property named Prop2 for
Integer - Has a property named ObjProp of type
CustomObjA - ObjProp contains an instance of
CustomObjB CustomObjBinherits fromCustomObjA- Has a property named ObjProp2 of type
CustomObjC

Do not include the class name (conventional format)
Create a Delivery Box using Create Object Delivery Box Using Json.

Serialized to the following json text
{
"Prop2": 1,
"ObjProp":
{
"ValueB": 2,
"ValueA": 3
},
"ObjProp2":
{
"ValueC": "abc"
}
}
- Class names are not saved
- When deserializing, it is necessary to specify the target class (CustomObject1)
- ObjProp is restored as
CustomObjAtype, so ValueB implemented inCustomObjBis not restored
Include class name
Create a Delivery Box using Create Dynamic Object Delivery Box Using Json.

Serialized to the following json text
{
"Type": "CustomObject1_C",
"Body":
{
"Prop2": 1,
"ObjProp":
{
"Type": "CustomObjB_C",
"Body":
{
"ValueB": 2,
"ValueA": 3
}
},
"ObjProp2":
{
"Type": "CustomObjC_C",
"Body":
{
"ValueC": "abc"
}
}
}
}
- Class names are saved
- No need to specify target class (CustomObject1) when deserializing
- ObjProp is restored as “CustomObjB” type, so ValueB implemented in “CustomObjB” is also restored
Custom format (switch for each class)
Create a Delivery Box using Create Custom Object Delivery Box Using Json.
This allows you to choose whether to include the class Type for each class.

Serialized to the following json text(For the above image settings)
{
"Prop2": 1,
"ObjProp":
{
"Type": "CustomObjB_C",
"Body":
{
"ValueB": 2,
"ValueA": 3
}
},
"ObjProp2":
{
"ValueC": "abc"
}
}
- Set the default serialization method type to
Default Serializer Type - If you specify
No Write Typein Default Serializer Type, you must always specifyTarget Class. - Set the object class and serialization method type of the property as a pair in
Object Serializer Types