Skip to content

Actor serialization doesn't work as dapr client #1050

Description

@francotiveron

I am using custom System.Text.Json converters in my dapr application. I set the serialization options to the same value for both dapr client and actors

builder.Services
    .AddControllers()
    .AddDapr(fun daprClientBuider -> daprClientBuider.UseJsonSerializationOptions(App.JsonSerializationOptions) |> ignore)

builder.Services.AddActors(fun actorRuntimeOptions -> actorRuntimeOptions.JsonSerializerOptions <- App.JsonSerializationOptions)

DaprClient calls work as expected with the custom converters

Expected Behavior

Actor calls should also feature the custom converters

Actual Behavior

Actor calls throw serialization exception

System.Runtime.Serialization.SerializationException: Type 'Yatp.Domain.CardValue+Grid' with data contract name 'CardValue.Grid:http://schemas.datacontract.org/2004/07/Yatp.Domain' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions