mirror of
https://github.com/google/flatbuffers.git
synced 2025-04-08 09:12:14 +08:00
Updates copyright from 2023 to 2024 & formats code - updates formatting rules Updates CI to run with swift 5.8 Adds wasmer & updates command to run carton as a swift plugin Update bazelci to also accept swift 5.8 Adds swift 5.10 to the test matrix
Languages known issues
Python
- Assert the type required in your server/client since python is able to receive
Bytes array
orutf8 strings
.
def SayHello(self, request, context):
# request might be a byte array or a utf8 string
r = HelloRequest.HelloRequest().GetRootAs(request, 0)
reply = "Unknown"
if r.Name():
reply = r.Name()
# Issues might happen if type checking isnt present.
# thus encoding it as a `reply.decode('UTF-8')`
return build_reply("welcome " + reply.decode('UTF-8'))
This can be prevented by making sure all the requests coming to/from python are Bytes array
def say_hello(stub, builder):
hello_request = bytes(builder.Output())
reply = stub.SayHello(hello_request)
r = HelloReply.HelloReply.GetRootAs(reply)
print(r.Message())
Go
- Always requires the
content-type
of the payload to be set toapplication/grpc+flatbuffers
example: .SayHello(ctx, b, grpc.CallContentSubtype("flatbuffers"))