Skip to content

Use Source Generators for Serialization/Deserialization #376

@Velociraptor45

Description

@Velociraptor45

As .net continuously moves in the direction of AoT compilation, it would be great to support non-reflection based serialization & deserialization through source generators.

I had a quick stroll through the codebase, and it should be possible to implement I'd say. The only tricky parts are

  • The Dictionary<string, object> as object can be anything and the Serializer needs to have the exact type in its source generator registered. I haven't looked that deep into it, but maybe the object types are mostly string or at least generally known?
  • The generic T response deserialization where the user can provide any T (e.g. ReadSecretAsync<T>), but this then has to be configured by the users themselves - maybe by registering their own custom TypeInfoResolver?

Would be great if you could consider this. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions