Skip to content

Support generic Temporal transfer type converters #845

Description

@tconley1428

Problem

TemporalTransferTypePayloadConverter rejects converter types with open generic parameters. This prevents generators such as nexgen from registering transfer converters for generic protobuf-backed models.

Proposed behavior

Allow a matching open generic converter declaration:

[TemporalTransferTypeConverter(typeof(ModelTransferTypeConverter<>))]
public sealed class Model<T>
{
}

When serializing a concrete runtime type, or deserializing to a requested closed type, the SDK should:

  1. Close the converter definition with the model type's generic arguments.
  2. Apply the existing converter validation to that closed type.
  3. Instantiate and cache the converter by closed model type.

Initial scope

The first version can require converter and model generic arity and argument order to match. That fully supports generated models.

A later converter-factory API could support hand-authored mappings whose converter generic shape differs from the model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions