Skip to content

Commit 0b50c1e

Browse files
authored
Merge pull request #1524 from WickyNilliams/fix/improve-nullable-field
Fix: keep type information for nullable fields when possible
2 parents 4b879e7 + fe6c6d1 commit 0b50c1e

File tree

5 files changed

+80
-64
lines changed

5 files changed

+80
-64
lines changed

.changeset/loud-items-hope.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openapi-typescript": patch
3+
---
4+
5+
Keep type information for nullable fields when possible

packages/openapi-typescript/examples/digital-ocean-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9085,7 +9085,7 @@ export interface external {
90859085
* @description The Droplet that the floating IP has been assigned to. When you query a floating IP, if it is assigned to a Droplet, the entire Droplet object will be returned. If it is not assigned, the value will be null.
90869086
* @example null
90879087
*/
9088-
droplet?: unknown;
9088+
droplet?: (Record<string, unknown> | null) | external["resources/droplets/models/droplet.yml"];
90899089
/**
90909090
* @description A boolean value indicating whether or not the floating IP has pending actions preventing new ones from being submitted.
90919091
* @example true
@@ -13948,7 +13948,7 @@ export interface external {
1394813948
* @description The Droplet that the reserved IP has been assigned to. When you query a reserved IP, if it is assigned to a Droplet, the entire Droplet object will be returned. If it is not assigned, the value will be null.
1394913949
* @example null
1395013950
*/
13951-
droplet?: unknown;
13951+
droplet?: (Record<string, unknown> | null) | external["resources/droplets/models/droplet.yml"];
1395213952
/**
1395313953
* @description A boolean value indicating whether or not the reserved IP has pending actions preventing new ones from being submitted.
1395413954
* @example true

0 commit comments

Comments
 (0)