Skip to content

Commit

Permalink
codegen(ts): to/from json methods for Tempo
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmd5 committed Jun 22, 2023
1 parent 3417fb9 commit a13d930
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Core/Generators/TypeScript/TypeScriptGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,8 @@ public override string Compile(Version? languageVersion, TempoServices services
builder.AppendLine($"invoke: service.{methodName},");
builder.AppendLine($"serialize: {method.Definition.ReturnDefintion}.encode,");
builder.AppendLine($"deserialize: {method.Definition.RequestDefinition}.decode,");
builder.AppendLine($"toJson: {method.Definition.ReturnDefintion}.encodeToJson,");
builder.AppendLine($"fromJson: {method.Definition.RequestDefinition}.fromJson,");
builder.AppendLine($"type: MethodType.{RpcSchema.GetMethodTypeName(methodType)},");
}, close: $"}} as BebopMethod<I{method.Definition.RequestDefinition}, I{method.Definition.ReturnDefintion}>);");
}
Expand Down Expand Up @@ -1047,6 +1049,8 @@ public override string Compile(Version? languageVersion, TempoServices services
builder.AppendLine($"id: {method.Id},");
builder.AppendLine($"serialize: {method.Definition.RequestDefinition}.encode,");
builder.AppendLine($"deserialize: {method.Definition.ReturnDefintion}.decode,");
builder.AppendLine($"toJson: {method.Definition.RequestDefinition}.encodeToJson,");
builder.AppendLine($"fromJson: {method.Definition.ReturnDefintion}.fromJson,");
builder.AppendLine($"type: MethodType.{RpcSchema.GetMethodTypeName(methodType)},");
});

Expand Down

0 comments on commit a13d930

Please sign in to comment.