Implement deserialisation from a JSON representation