private static JObject PathToJObject(Path p) { return new JObject(p.Operations.Select( op => new JProperty(op.Key, OpToJObject(op.Value)))); }