Skip to content

[BUG][TYPESCRIPT] date-timing-parsing is truncating the time #4623

@gonozalviii

Description

@gonozalviii
Description

When declaring a field with type: string, format: data-time I expect to get date and time information. Current behavior is that only date information is available. This is a change in behavior to versions prior 4.2.1 and breaks interoperability with other languages like java-spring (Date cannot be parsed into OffsetDateTime).

openapi-generator version

Bug was introduced with 4.2.1, commit cd11cc2

Related issues/PRs

Bug was introduced by:
#4337

Suggest a fix

api.service.mustache:185
({{paramName}} as any).toISOString().substr(0, 10)

substr function is truncation the time and should be removed

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions