StaticStruct:Identifier not found

Hello! I’m having trouble passing in a value to a function in UE4. Here I have this bit of code within my CPP:

FJsonObjectConverter::JsonObjectStringToUStruct(g, FEncodedString::StaticStruct(), 0, 0);

Whilst here in my MyActor.h I have this USTRUCT:

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Runtime/Online/HTTP/Public/Http.h"
#include "Runtime/Json/Public/Dom/JsonObject.h"
#include "Runtime/Json/Public/Serialization/JsonSerializer.h"
#include "Runtime/Core/Public/Misc/Base64.h"
#include "Runtime/JsonUtilities/Public/JsonObjectWrapper.h"
#include "Runtime/JsonUtilities/Public/JsonObjectConverter.h"
#include "MyActor.generated.h"

//If you want this to appear in BP, make sure to use this instead

struct FEncodedString

	UPROPERTY(BlueprintReadWrite, Category = "Common")
	FString encoded;

	FString str()
		return encoded;

		encoded = "";

When building and running the code, it spits out the errors:
“StaticStruct:Identifier not Found”
“StaticStruct’: is not a member of 'UScriptStruct”

This is a question concerning, both, proper UStructDeclaration, and if it has anything to do with these errors.
Also if not, what is the cause. Is there a way to declare a StaticStruct within my Struct. Are there examples?

Any help would be greatly appreciated! And assuming anyone has any insight on this, please try and help this person who also seems to be in a similar situation: JsonObjectStringToStruct - 'StaticStruct': is not a member of 'UStruct' - Programming & Scripting - Unreal Engine Forums

Thank you!

You need to create an actual variable of type FEncodedString so you can save this parsed json data

FEncodedString MyObject;
FJsonObjectConverter::JsonObjectStringToUStruct(g, &MyObject, 0, 0);

// MyObject will now contain the parsed json data that was stored in the string g

Here’s an engine example: Link

Thank you! The link is broken, though. :’(

You need to be logged in to GitHub and have UE code linked to your account for it to work :slight_smile: The above code example should be enough though