JsonObjectStringToStruct - 'StaticStruct': is not a member of 'UStruct'

I try to compile the following code, but it throws the following error:
‘StaticStruct’: is not a member of ‘UStruct’.
I know that if I create an USTRUCT() in the header then it would work, but I hope there is a way to allow me to pass the struct as parameter, because I would like to make the structs as blueprints.

UStruct* UPacket::GetData(UStruct* dataStruct)
{
	FJsonObjectConverter::JsonObjectStringToUStruct(this->data, dataStruct, 0, 0);
	return dataStruct;
}

UStruct is the type of the struct, as opposed to the variable. You need a variable to save the parsed json data

Try this

template<typename T>
void UPacket::GetData(T& dataStruct)
 {
     FJsonObjectConverter::JsonObjectStringToUStruct(this->data, &dataStruct, 0, 0);
 }

///////////////////////////
USTRUCT()
struct FMyStruct {
    // ...
};

//////
FMyStruct Data;
Packet->GetData(Data);
//////