I was wondering what the general opinion was about using different serialization methods for REST APIs. JSON and XML are the most popular but I was wondering if serialization in Flatbuffers might be a possible alternative.
Deserialization on the server side is technically cheaper than JSON (the big win is "zero-copy" reads and fast serialization responses on larger servers). On the client browser FB serialization would be slower than JSON (JSON serial/deserial is implemented natively) but I think that's minor given that the datasets are extremely small the user wouldn't notice a difference anyways.
I imagine REST purists would say this is taboo. The downsides would be:
This thought came from the fact that I'm using FB in gRPC and now have to accept requests via browser. Transforming from REST adds an extra serialization step (if I took a similar approach to using gRPC-Web).
There is nothing about REST that specifically dictates or suggest any mimetype. REST predates JSON, so purists definitely should not call this taboo =)