Simple object parsing problem with MiniJSON

I’m having a bit of trouble getting my object to serialise with MiniJSON.

class simple {
	var stringd : String = "hello";
}

function Start() {
	var s = new simple();
	var st = MiniJSON.jsonEncode(s);
	print(st);
}

prints “null”.

as you can see its the most simple object in the world. But the json parse still returns null.

Can MiniJSON actually encode objects like?

Maybe you should extend from System.Object?

class simple extends System.Object {
	function getString() : String {
		return "hello";
	}
}

function Start() {
    var s = new simple();
    var st = MiniJSON.jsonEncode(s.getString());
    print(st);
}