Skip to content
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

PhantomData<T> serializes to unit struct, not T #5

Open
HactarCE opened this issue Aug 7, 2023 · 1 comment
Open

PhantomData<T> serializes to unit struct, not T #5

HactarCE opened this issue Aug 7, 2023 · 1 comment

Comments

@HactarCE
Copy link

HactarCE commented Aug 7, 2023

The crate docs says that PhantomData<T> currently translates to the Zod schema T. This should not be the case; PhantomData<T> does not contain a T and is thus serialized as a unit struct. It merely appears to contain a a T for the sake of subtyping/variance, which I believe is irrelevant for this crate.

@nicolaiunrein
Copy link
Owner

I agree. However I am almost done with a complete rewrite to fully support generics. I'll keep this issue in mind.

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

No branches or pull requests

2 participants