Skip to content

Commit 4e51272

Browse files
committed
docs(migration): document TypeScript Date mapping
1 parent c1efdae commit 4e51272

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/migrations/version-5-to-6.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,33 @@ const models = await generator.generateCompleteModels(schema, {
5252

5353
The generated Python code behavior remains unchanged - all imports will continue to use the explicit style.
5454

55+
## Typescript
56+
### Date formats now generate `Date` instead of `string`
57+
58+
In Modelina v5, OpenAPI schema fields with type `string` and formats such as
59+
`date-time`, `date`, or `time` were generated as `string` in TypeScript models.
60+
61+
Starting from v6, these formats are now mapped to the native `Date` type.
62+
63+
This is a **breaking change** and may require updates in consumer code.
64+
65+
#### What changed
66+
67+
**Before (v5):**
68+
```ts
69+
sentAt?: string;
70+
```
71+
72+
**After(v6):**
73+
```ts
74+
sentAt?: Date;
75+
```
76+
#### Migration notes
77+
78+
- Update TypeScript type annotations that previously expected `string`
79+
- Ensure any custom serialization or parsing logic handles `Date` objects
80+
- Update mocks, tests, and fixtures that rely on string values for date fields
81+
5582
## AsyncAPI
5683

5784
### Improved schema naming strategy

0 commit comments

Comments
 (0)