From da7b95838ef5ea46e3202b8ab8d24f0b0f674be0 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Fri, 30 Apr 2021 13:54:23 -0700 Subject: [PATCH] Always pass serializer options to JSON serializer Fixes: #664 This fixes an issue where we're not passing the serializer options to the deserialize method for a user-specified payload. This was just an oversight and did not behave as expected when users have customized the settings. (cherry picked from commit 710868c66e66049cddf00fef3e4e9b6d3ade5509) --- src/Dapr.Actors/Client/ActorProxy.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Dapr.Actors/Client/ActorProxy.cs b/src/Dapr.Actors/Client/ActorProxy.cs index cc555312..00c4534e 100644 --- a/src/Dapr.Actors/Client/ActorProxy.cs +++ b/src/Dapr.Actors/Client/ActorProxy.cs @@ -114,7 +114,7 @@ namespace Dapr.Actors.Client await stream.FlushAsync(); var jsonPayload = Encoding.UTF8.GetString(stream.ToArray()); var response = await this.actorNonRemotingClient.InvokeActorMethodWithoutRemotingAsync(this.ActorType, this.ActorId.ToString(), method, jsonPayload, cancellationToken); - return await JsonSerializer.DeserializeAsync(response); + return await JsonSerializer.DeserializeAsync(response, JsonSerializerOptions); } /// @@ -144,7 +144,7 @@ namespace Dapr.Actors.Client public async Task InvokeMethodAsync(string method, CancellationToken cancellationToken = default) { var response = await this.actorNonRemotingClient.InvokeActorMethodWithoutRemotingAsync(this.ActorType, this.ActorId.ToString(), method, null, cancellationToken); - return await JsonSerializer.DeserializeAsync(response); + return await JsonSerializer.DeserializeAsync(response, JsonSerializerOptions); } ///