You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found that for gRpc calls, the deserialization of dictionaries with nullable value types changes, purely by including/removing the protobuf-net.Grpc.AspNetCore.Reflection package.
Setup:
Data contract:
[DataContract]
public class TestDataContract
{
[DataMember(Order = 1)]
public IDictionary<string, string?> Test { get; set; } = new Dictionary<string, string?>();
}
Service:
[gRpcService]
public class TestGrpcService : ITestGrpc
{
public async Task<TestDataContract> TestAsync(CallContext context = default)
{
return new TestDataContract {
Test = new Dictionary<string, string?>() { { "test1", "blabla" }, { "test", null } }
};
}
}
Client:
...
var response = await testGrpcClient.Test();
...
I'm using protobuf-net.Grpc.AspNetCore.Reflection --version 1.1.1
The text was updated successfully, but these errors were encountered:
helm100
changed the title
Inconsistency: Using package changes how dictionaries with nullable value types are deserialized
Inconsistency: Using protobuf-net changes how dictionaries with nullable value types are deserialized
Jun 21, 2024
I've found that for gRpc calls, the deserialization of dictionaries with nullable value types changes, purely by including/removing the
protobuf-net.Grpc.AspNetCore.Reflection
package.Setup:
Data contract:
Service:
Client:
WITH package, response =
{ { "test1", "blabla" }, { "test", "" } }
WITHOUT package, response =
{ { "test1", "blabla" }, { "test", null } }
I'm using protobuf-net.Grpc.AspNetCore.Reflection --version 1.1.1
The text was updated successfully, but these errors were encountered: