Skip to content

Commit 51fd74c

Browse files
committed
Pass in options to JsonNode/JsonElement serialization
1 parent 3d5136c commit 51fd74c

File tree

1 file changed

+2
-2
lines changed
  • third_party/dotnet/devtools/src/generator/Templates

1 file changed

+2
-2
lines changed

third_party/dotnet/devtools/src/generator/Templates/domain.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ namespace {{rootNamespace}}.{{domain.Name}}
5151
{{#if NoParameters}}
5252
command ??= new {{dehumanize Name}}CommandSettings();
5353
{{/if}}
54-
global::System.Text.Json.Nodes.JsonNode serializedCommand = global::System.Text.Json.JsonSerializer.SerializeToNode(command, {{../rootNamespace}}.{{../protocolVersion}}JsonSerializerContext.Default);
54+
global::System.Text.Json.Nodes.JsonNode serializedCommand = global::System.Text.Json.JsonSerializer.SerializeToNode(command, {{../rootNamespace}}.{{../protocolVersion}}JsonSerializerContext.Default.Options);
5555
global::System.Text.Json.JsonElement? response = await Session.SendCommand(command.CommandName, serializedCommand, cancellationToken, millisecondsTimeout, throwExceptionIfResponseNotReceived).ConfigureAwait(false);
5656

5757
if (response == null)
5858
{
5959
return default({{dehumanize Name}}CommandResponse);
6060
}
6161

62-
return global::System.Text.Json.JsonSerializer.Deserialize<{{dehumanize Name}}CommandResponse>(response.Value, {{../rootNamespace}}.{{../protocolVersion}}JsonSerializerContext.Default);
62+
return global::System.Text.Json.JsonSerializer.Deserialize<{{dehumanize Name}}CommandResponse>(response.Value, {{../rootNamespace}}.{{../protocolVersion}}JsonSerializerContext.Default.Options);
6363
}
6464

6565
{{/each}}

0 commit comments

Comments
 (0)