Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Serializer] Allow to deserialize generic collections (do not throw away the types) #45728

Closed
@simPod

Description

@simPod

Description

I'd like to use Serializer component to deserialize json array into a generic collection.

Related:

Example

final class A
{
    /** @param \Ds\Set<MyId> $ids */
    public function __construct(
        public \Ds\Set $ids
    ) {
    }

For that, I though I'd implement my own denormalizer (ContextAwareDenormalizerInterface). However, the generic type is stripped and simplified into \Ds\Set by PropertyTypeExtractorInterface so basically it is not possible to do serde of this kind of types.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions