Convert protobuf classes to and from rapidjson objects.