Skip to content

Commit 09d0406

Browse files
Fix to allow string dates in typescript-node generator
1 parent 8b5b5a7 commit 09d0406

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • modules/openapi-generator/src/main/resources/typescript-node

modules/openapi-generator/src/main/resources/typescript-node/models.mustache

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ export class ObjectSerializer {
119119
}
120120
return transformedData;
121121
} else if (type === "Date") {
122+
if (typeof data === "string") {
123+
return new Date(data).toISOString();
124+
}
122125
return data.toISOString();
123126
} else {
124127
if (enumsMap[type]) {

0 commit comments

Comments
 (0)