How do I properly utilize JsonObjectStringToUStruct?

TheAggie
Sat, 29 Mar 2014 05:40:46 +0000
Editor Scripting

I’m trying to take an object from a json http response and convert it to a UStruct. I came across the JsonObjectStringToUStruct function via JsonUtilities.h. While it looks like the solution to my problem, I’m having some issues with it. I haven’t worked in c++ in forever, so please forgive me for any syntax issues. Anyway, I’m not exactly sure how to properly supply the parameters needed by this procedure. Specifically the structure definition UStruct. I’m assuming this is for mapping parameters from json into the corresponding properties of the output struct, but I’m not sure what that is supposed to look like.

Any help would be greatly appreciated. Here is the basics of what I have so far.

const UStruct *structDefinition = {
    // What do I do with this.. if anything?
    		};

    FTestObjectStruct testObjectStructOut = FTestObjectStruct();

    bool bSomePropertiesWereWritten = FJsonObjectConverter::JsonObjectStringToUStruct(jsonResponseString, structDefinition, &testObjectStructOut, 0, 0);

7 posts - 5 participants