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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
simPod opened this issue Mar 13, 2022 · 12 comments
Closed

Comments

@simPod
Copy link
Contributor

simPod commented Mar 13, 2022

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.

@carsonbot
Copy link

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@simPod
Copy link
Contributor Author

simPod commented Oct 29, 2022

No

@carsonbot carsonbot removed the Stalled label Oct 29, 2022
@carsonbot
Copy link

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@simPod
Copy link
Contributor Author

simPod commented May 3, 2023 via email

@carsonbot carsonbot removed the Stalled label May 3, 2023
@carsonbot
Copy link

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@simPod
Copy link
Contributor Author

simPod commented Nov 4, 2023 via email

@carsonbot carsonbot removed the Stalled label Nov 4, 2023
@xabbuh
Copy link
Member

xabbuh commented Nov 5, 2023

@simPod Are you interested in contributing this feature? PR welcome I guess.

@xabbuh xabbuh added the Feature label Nov 5, 2023
@mtarld
Copy link
Contributor

mtarld commented Nov 23, 2023

Hey @simPod and @xabbuh!

With the introduction of the TypeInfo component (#52510), and the integration of in the PropertyInfo component, generics will be parsed properly, so it'll be possible to create that custom normalizer.

So IMHO, instead of creating a new feature, it could be great to wait for that component to be merged (hope it'll be 🤞)

@simPod
Copy link
Contributor Author

simPod commented Nov 23, 2023

I'll not pursue implementing it. @mtarld thanks for info!

@carsonbot
Copy link

Thank you for this suggestion.
There has not been a lot of activity here for a while. Would you still like to see this feature?

@carsonbot
Copy link

Could I get an answer? If I do not hear anything I will assume this issue is resolved or abandoned. Please get back to me <3

@carsonbot
Copy link

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants