Lossless serialisation and parsing of JSON structures for complex objects