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

When in request specification parameter type is "string" and format is "date-time" cutting to date #6602

Open
agorshkov23 opened this issue Jun 9, 2020 · 1 comment

Comments

@agorshkov23
Copy link

agorshkov23 commented Jun 9, 2020

Regardless of the format parameter (date or datetime), the value is truncated to the date.

paths..get.parameters
image

(value as Date).toISOString(){{^isDateTime}}.substr(0, 10)){{/isDateTime}};

@amakhrov
Copy link
Contributor

Looks like an error in the template. The way it's structured, there is no simple way to fix it though - this serialization is generic, without knowledge of specific parameter types from the spec.

However, more importantly, Date should not be allowed as a service method argument in the first place. It should all be strings. Are you using the latest version of the generator? Do you have custom type mapping for dates specified as a cli argument?

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

No branches or pull requests

3 participants