serialisation code for openjib