New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
integration of flatbuffers in request and response #9
Comments
Hi @sandys, I've been thinking about how we could add new serialization formats into this lib, specifically about Avro, protobuf & msgpack. Now there's another format that you propose, so I guess this might be implemented in the future. There is actually not much work to do: create custom Response class & Route class. Reference: tiangolo/fastapi#521 But it would require additional deps to be installed. I guess we can just copy-paste the somewhat standard practice of making optional deps and making them required only for specific features. For example, I don't think I have time to do something like this in next couple of weeks, but you are very welcome to send PR. |
My understanding is that protobuf and flatbuffer should be pretty similar to implement (I haven't looked into it deeply though). The biggest challenge seems to me to be generating the specs from the pydantic models -- that may be worth a pydantic feature request (if such a request hasn't already been addressed anyway). |
Flatbuffers is the high performance serialization library from Google - https://google.github.io/flatbuffers/flatbuffers_guide_use_python.html
It has compatible libraries for java (android), javascript and python.
Is it possible for you to create functionality that happens automatically for each endpoint - that it accepts data in flatbuffers and gives response in flatbuffers if the request has
Accept: application/x-flatbuffers
in it.e.g.
curl -D- -H "Accept: application/x-flatbuffers" http://localhost:7002
if the header is not present, then the endpoint works with default json
The text was updated successfully, but these errors were encountered: