-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Using type
instead of interface
does not generate the same schemas name
#708
Comments
Only It's because in the TypeScript compiler API, the |
What about a way to name a schema from a tag? export type EditableLandingText = Partial<
Omit<LandingText, 'slug' | 'createdAt' | 'updatedAt'>
> & tags.Name<"EditableLandingText">; that would also be helpfull for type definitions like interface A {
var1: string
var2: {
fi: string
fa: string
fo: string
} & tags.Name<'MyCustomName'> // Would have been called _type.01 otherwise
} because currently the it also name the sub schemas in those cases Maybe this is too much overhead idk. I will also be fine with using interface all the time instead of type. As you said if type is an alias it makes sense that typescript does not keep track of the name and just replace it on the spot. |
Well, the way using type tag seems more terrible. It would be better to finding the detour way for only one object alias type case by hard coding \o/. Wait a week please. |
Summary
Using a type instead of an interface does not generate the same schemas
Expected behavior:
the two types should either have the same names or we should have a way to specify the name
Actual behavior:
The name of the schemas differ
Code occuring the bug
The text was updated successfully, but these errors were encountered: