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

Add a cli option to specify date type #2237

Open
1 task
bryanjtc opened this issue Mar 29, 2025 · 1 comment
Open
1 task

Add a cli option to specify date type #2237

bryanjtc opened this issue Mar 29, 2025 · 1 comment
Labels
enhancement New feature or request openapi-ts Relevant to the openapi-typescript library

Comments

@bryanjtc
Copy link

Description

I need to use the node api to make sure date-times are parsed as Dates and not strings.

Proposal

Create a simple cli flag: --date-time-type
Allow the values string or date

Extra

@bryanjtc bryanjtc added enhancement New feature or request openapi-ts Relevant to the openapi-typescript library labels Mar 29, 2025
@duncanbeevers
Copy link
Contributor

You can already accomplish this with the Node.js API and the transform option.
Because individual needs are likely to differ, it is unlikely this kind of functionality would be exposed as a command-line flag.

This library has no effect on how your data is parsed, so even if you're generating type Date for specific fields you'll need accompanying code to transform the JSON.parse results to something bespoke.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request openapi-ts Relevant to the openapi-typescript library
Projects
None yet
Development

No branches or pull requests

2 participants