mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-10 15:16:28 +00:00
[Swift] Optional Scalars Preparation (#6028)
* Perpares swift to take optional scalars + adds optional string helper method + disables linters in generated code * Small fix for generated code * Update grpc support to alpha 17 for swift
This commit is contained in:
@@ -164,7 +164,7 @@ grpc::string GenerateServerExtensionBody(const grpc_generator::Method *method) {
|
||||
grpc::string start = "\t\tcase \"$MethodName$\":\n\t\t";
|
||||
if (method->NoStreaming()) {
|
||||
return start +
|
||||
"return UnaryCallHandler(callHandlerContext: callHandlerContext) { "
|
||||
"return CallHandlerFactory.makeUnary(callHandlerContext: callHandlerContext) { "
|
||||
"context in"
|
||||
"\n\t\t\t"
|
||||
"return { request in"
|
||||
@@ -175,7 +175,7 @@ grpc::string GenerateServerExtensionBody(const grpc_generator::Method *method) {
|
||||
}
|
||||
if (method->ClientStreaming()) {
|
||||
return start +
|
||||
"return ClientStreamingCallHandler(callHandlerContext: "
|
||||
"return CallHandlerFactory.makeClientStreaming(callHandlerContext: "
|
||||
"callHandlerContext) { context in"
|
||||
"\n\t\t\t"
|
||||
"self.$MethodName$(context: context)"
|
||||
@@ -183,7 +183,7 @@ grpc::string GenerateServerExtensionBody(const grpc_generator::Method *method) {
|
||||
}
|
||||
if (method->ServerStreaming()) {
|
||||
return start +
|
||||
"return ServerStreamingCallHandler(callHandlerContext: "
|
||||
"return CallHandlerFactory.makeServerStreaming(callHandlerContext: "
|
||||
"callHandlerContext) { context in"
|
||||
"\n\t\t\t"
|
||||
"return { request in"
|
||||
@@ -194,7 +194,7 @@ grpc::string GenerateServerExtensionBody(const grpc_generator::Method *method) {
|
||||
}
|
||||
if (method->BidiStreaming()) {
|
||||
return start +
|
||||
"return BidirectionalStreamingCallHandler(callHandlerContext: "
|
||||
"return CallHandlerFactory.makeBidirectionalStreaming(callHandlerContext: "
|
||||
"callHandlerContext) { context in"
|
||||
"\n\t\t\t"
|
||||
"self.$MethodName$(context: context)"
|
||||
|
||||
Reference in New Issue
Block a user