I’m calling an API using C++. When the response is only one element, the deserializing is completed successfully.
As when I send an Array of the same object as response, the deserialize will fail.
Any Idea how to solve this issue?
Here’s my code:
//Declare json as string variable
FString JsonString = Response->GetContentAsString();
//Create a pointer to hold the json serialized data
TSharedPtr<FJsonObject> JsonObject = MakeShareable(new FJsonObject());
//Create a reader pointer to read the json data
TSharedRef<TJsonReader<TCHAR>> JsonReader = TJsonReaderFactory<TCHAR>::Create(JsonString);
bool isValidJson = JsonObject.IsValid();
bool isDeserialized = FJsonSerializer::Deserialize(JsonReader, JsonObject);