API Reference
UWebSockLib.FromJSON
FromJSON is a polymorphic serialisation BlueprintCallable
function that takes an FString payload and, if possible, returns the appropriate USTRUCT.
Usage
/**
* (BP) Deserialises a USTRUCT from a JSON FString
* @param OutResult If the operation was successful
* @param InJSON The FString containing the JSON representation of a USTRUCT
* @param OutStruct The USTRUCT that will be deserialised from our FString
*/
UFUNCTION(BlueprintCallable, CustomThunk, Category = "WebSock",
meta = (ExpandEnumAsExecs = "OutResult", AllowAbstract = "false", CustomStructureParam = "OutStruct"))
static void FromJSON(bool& OutResult, UPARAM(ref) const FString& InJSON, int32& OutStruct)
Blueprints
Connect any USTRUCT to the output wildcard parameter
C++
If using C++ you can use the native equivalent UWebSockLib::JSONToScriptStruct<T>
/**
* (Native) Deserialise a USTRUCT from a JSON FString
* @tparam T USTRUCT type
* @param InJSON The FString containing the JSON representation of a USTRUCT<T>
* @return Deserialised T, or default value
*/
template <typename T = UScriptStruct>
static T JSONToScriptStruct(const FString& InJSON)