Page MenuHomeFeedback Tracker

class JsonSerializer: Serializer
Assigned, UrgentPublic

Description

While trying to use JsonSerializer WriteToString to send json file to discords webhook api
Their is a type conversion that prevents me from setting a bool
If I set a json field / value as true when i print the string the value reads as a int 1 or 0 for false

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Operating System Version
21H2
Category
General
Steps To Reproduce

class jsontest{

void jsontest(){

		Print("jsontest constructor ran  ");
		runtest();

};

void runtest(){

		JsonSerializer m_Serializer;
		string DiscordJson = Gettestdata();
		if ( !m_Serializer )
			m_Serializer = new JsonSerializer;

		m_Serializer.WriteToString( dce_tmp, false, DiscordJson )
		Print(DiscordJson);

};
};

class testdata{
string name = "lanky";
int yearborn = 91;
bool hasmadeamod = true;
};

static ref testdata g_testdata;
static ref testdata Gettestdata(){

g_testdata = new testdata;
return g_testdata;

};

Additional Information

result
{
"name":"lanky",
"yearborn":91,
"hasmadeamod":1
}

Event Timeline

Geez changed the task status from New to Assigned.Oct 16 2022, 9:00 PM