santa
santa copied to clipboard
Replace the manual parser in santactl/sync with a protobuf
Proto3 has a canonical JSON encoding for proto messages (though as far as I can tell this isn't supported by the Objective-C library at the moment).
It would be nice to use this instead of our hand-written JSON parser, which while fuzzed and probably relatively bug-free now is a bit of a pain to maintain and it's a lot of code. It would also allow the proto file to serve as documentation of what fields are in each request and response and and how those fit together.
Unfortunately this will have to wait until after switching to Bazel for building (as the alternative is a lot more work) and for the ObjC API to support JSON encoding, otherwise we'll have to use the C++ API (which wouldn't be terrible but would involve a lot of conversions from NSString
to std::string
)
Would also be great to be able to use the interface definition in Upvote and not manually duplicate it.
Good point. Thankfully the Python API does have functions for converting to and from JSON, so that's nice.
At this point I think this is blocked by #744.
This is not blocked by #744 and probably worth doing around the 2023.10 release.