-
Notifications
You must be signed in to change notification settings - Fork 9
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
Typescript type "Date" is misrecognized as user-defined type #17
Comments
Facing same problem |
Why do you expect typeconv can't guess how you transform a This quite special case with dates, perhaps could benefit from something like special treatment, but I've seen quite a few issues with assumptions of date handling/parsing to/from Date leading to invalid results (e.g. timezone issues). I would recommend |
You seem to be missing my point
My workaround was to define any date containing fields as Although I managed to hack my way around it, it doesn't feel like a proper way to deal with it. Yes, dates are always a pain in the neck, so I'm not surprised that they are problematic in that case aswell. Some flag or something like that would be nice, so the converter would deal with |
Right, the reason is, it doesn't understand any built-in type. Not I think it'd make sense to default all of these to I'm going to give this some thinking, perhaps being able to customize a mapping table yourself (like a |
I have a script running from CLI which transforms typescript definitions to openapi. When having a model like this
the output is this
The Date type is being interpreted as a user defined type, but it is not. It's a native type
Expected output is
The text was updated successfully, but these errors were encountered: