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

TDate returning wrong values for OpenAI document #124

Open
Hoyci opened this issue May 16, 2024 · 1 comment
Open

TDate returning wrong values for OpenAI document #124

Hoyci opened this issue May 16, 2024 · 1 comment

Comments

@Hoyci
Copy link

Hoyci commented May 16, 2024

I'm creating a documentation for my API, but when I create a Response t.Object like this:
t.Object({ user: t.Object({ id: t.String(), email: t.String(), createdAt: t.Date(), updatedAt: t.Date() }) })

image

createdAt and updatedAt is transformed for this on the OpenAPI Document
"createdAt": { "anyOf": [ { "type": "Date" }, { "format": "date", "default": "2024-05-16T23:05:28.064Z", "type": "string" }, { "format": "date-time", "default": "2024-05-16T23:05:28.064Z", "type": "string" } ] }, "updatedAt": { "anyOf": [ { "type": "Date" }, { "format": "date", "default": "2024-05-16T23:05:28.065Z", "type": "string" }, { "format": "date-time", "default": "2024-05-16T23:05:28.065Z", "type": "string" } ] } },

And to work well needs to be like:

"createdAt": { "format": "date", "default": "2024-05-16T23:05:28.065Z", "type": "string" }

image

Is this an error in my code or a bug on elysia-swagger?

@darr1s
Copy link

darr1s commented Jun 15, 2024

Facing this issues as well.

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