Skip to content

Commit

Permalink
Merge pull request #269 from betwixt-labs/tempo-json-ts
Browse files Browse the repository at this point in the history
codegen(ts): support to/from json methods in Tempo methods
  • Loading branch information
andrewmd5 authored Jun 22, 2023
2 parents 3417fb9 + cb42d0d commit 843a831
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION="2.8.0"
VERSION="2.8.1"
MAJOR=2
MINOR=8
PATCH=0
PATCH=1
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 843a831

Please sign in to comment.