Skip to content

Commit e667190

Browse files
committed
correct expected test files to use null types if the corresponding schema is nullable
1 parent 92eb642 commit e667190

File tree

6 files changed

+153
-153
lines changed

6 files changed

+153
-153
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11634,7 +11634,7 @@ export interface components {
1163411634
* @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.
1163511635
* @example null
1163611636
*/
11637-
droplet?: Record<string, never> | components["schemas"]["droplet"];
11637+
droplet?: (Record<string, never> | null) | components["schemas"]["droplet"];
1163811638
/**
1163911639
* @description A boolean value indicating whether or not the floating IP has pending actions preventing new ones from being submitted.
1164011640
* @example true
@@ -11975,7 +11975,7 @@ export interface components {
1197511975
* @description An object of key/value mappings specifying labels to apply to all nodes in a pool. Labels will automatically be applied to all existing nodes and any subsequent nodes added to the pool. Note that when a label is removed, it is not deleted from the nodes in the pool.
1197611976
* @example null
1197711977
*/
11978-
labels?: Record<string, never>;
11978+
labels?: Record<string, never> | null;
1197911979
/** @description An array of taints to apply to all nodes in a pool. Taints will automatically be applied to all existing nodes and any subsequent nodes added to the pool. When a taint is removed, it is deleted from all nodes in the pool. */
1198011980
taints?: components["schemas"]["kubernetes_node_pool_taint"][];
1198111981
/**
@@ -13337,7 +13337,7 @@ export interface components {
1333713337
* @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.
1333813338
* @example null
1333913339
*/
13340-
droplet?: Record<string, never> | components["schemas"]["droplet"];
13340+
droplet?: (Record<string, never> | null) | components["schemas"]["droplet"];
1334113341
/**
1334213342
* @description A boolean value indicating whether or not the reserved IP has pending actions preventing new ones from being submitted.
1334313343
* @example true

packages/openapi-typescript/examples/github-api-export-type-immutable.ts

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -40001,7 +40001,7 @@ export type components = {
4000140001
readonly created_at: string;
4000240002
/** @description The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. */
4000340003
readonly dismissed_at: string | null;
40004-
readonly dismissed_by: Record<string, never>;
40004+
readonly dismissed_by: Record<string, never> | null;
4000540005
/** @description The reason for dismissing or closing the alert. Can be one of: `false positive`, `won't fix`, and `used in tests`. */
4000640006
readonly dismissed_reason: string | null;
4000740007
/**
@@ -41020,7 +41020,7 @@ export type components = {
4102041020
readonly display_title: string;
4102141021
readonly event: string;
4102241022
readonly head_branch: string;
41023-
readonly head_commit?: Record<string, never>;
41023+
readonly head_commit?: Record<string, never> | null;
4102441024
readonly head_repository?: {
4102541025
readonly archive_url?: string;
4102641026
readonly assignees_url?: string;
@@ -41323,7 +41323,7 @@ export type components = {
4132341323
readonly created_at: string;
4132441324
readonly event: string;
4132541325
readonly head_branch: string;
41326-
readonly head_commit?: Record<string, never>;
41326+
readonly head_commit?: Record<string, never> | null;
4132741327
readonly head_repository?: {
4132841328
readonly archive_url?: string;
4132941329
readonly assignees_url?: string;
@@ -41666,7 +41666,7 @@ export type components = {
4166641666
readonly created_at: string;
4166741667
readonly event: string;
4166841668
readonly head_branch: string;
41669-
readonly head_commit?: Record<string, never>;
41669+
readonly head_commit?: Record<string, never> | null;
4167041670
readonly head_repository?: {
4167141671
readonly archive_url?: string;
4167241672
readonly assignees_url?: string;
@@ -43136,7 +43136,7 @@ export type components = {
4313643136
readonly labels_url?: string;
4313743137
readonly language?: unknown;
4313843138
readonly languages_url?: string;
43139-
readonly license?: Record<string, never>;
43139+
readonly license?: Record<string, never> | null;
4314043140
readonly merges_url?: string;
4314143141
readonly milestones_url?: string;
4314243142
readonly mirror_url?: unknown;
@@ -43929,7 +43929,7 @@ export type components = {
4392943929
/** Format: uri */
4393043930
readonly url?: string;
4393143931
} | null;
43932-
readonly assignees?: readonly Record<string, never>[];
43932+
readonly assignees?: readonly (Record<string, never> | null)[];
4393343933
readonly author_association?: string;
4393443934
readonly body?: string | null;
4393543935
readonly closed_at?: string | null;
@@ -43956,10 +43956,10 @@ export type components = {
4395643956
}[];
4395743957
readonly labels_url?: string;
4395843958
readonly locked: boolean;
43959-
readonly milestone?: Record<string, never>;
43959+
readonly milestone?: Record<string, never> | null;
4396043960
readonly node_id?: string;
4396143961
readonly number?: number;
43962-
readonly performed_via_github_app?: Record<string, never>;
43962+
readonly performed_via_github_app?: Record<string, never> | null;
4396343963
readonly reactions?: {
4396443964
readonly "+1"?: number;
4396543965
readonly "-1"?: number;
@@ -44461,7 +44461,7 @@ export type components = {
4446144461
/** Format: uri */
4446244462
readonly url?: string;
4446344463
} | null;
44464-
readonly assignees?: readonly Record<string, never>[];
44464+
readonly assignees?: readonly (Record<string, never> | null)[];
4446544465
readonly author_association?: string;
4446644466
readonly body?: string | null;
4446744467
readonly closed_at?: string | null;
@@ -44488,10 +44488,10 @@ export type components = {
4448844488
}[];
4448944489
readonly labels_url?: string;
4449044490
readonly locked: boolean;
44491-
readonly milestone?: Record<string, never>;
44491+
readonly milestone?: Record<string, never> | null;
4449244492
readonly node_id?: string;
4449344493
readonly number?: number;
44494-
readonly performed_via_github_app?: Record<string, never>;
44494+
readonly performed_via_github_app?: Record<string, never> | null;
4449544495
readonly reactions?: {
4449644496
readonly "+1"?: number;
4449744497
readonly "-1"?: number;
@@ -44994,7 +44994,7 @@ export type components = {
4499444994
/** Format: uri */
4499544995
readonly url?: string;
4499644996
} | null;
44997-
readonly assignees?: readonly Record<string, never>[];
44997+
readonly assignees?: readonly (Record<string, never> | null)[];
4499844998
readonly author_association?: string;
4499944999
readonly body?: string | null;
4500045000
readonly closed_at?: string | null;
@@ -45021,10 +45021,10 @@ export type components = {
4502145021
}[];
4502245022
readonly labels_url?: string;
4502345023
readonly locked: boolean;
45024-
readonly milestone?: Record<string, never>;
45024+
readonly milestone?: Record<string, never> | null;
4502545025
readonly node_id?: string;
4502645026
readonly number?: number;
45027-
readonly performed_via_github_app?: Record<string, never>;
45027+
readonly performed_via_github_app?: Record<string, never> | null;
4502845028
readonly reactions?: {
4502945029
readonly "+1"?: number;
4503045030
readonly "-1"?: number;
@@ -45506,8 +45506,8 @@ export type components = {
4550645506
} | null;
4550745507
} & {
4550845508
readonly active_lock_reason?: string | null;
45509-
readonly assignee?: Record<string, never>;
45510-
readonly assignees?: readonly Record<string, never>[];
45509+
readonly assignee?: Record<string, never> | null;
45510+
readonly assignees?: readonly (Record<string, never> | null)[];
4551145511
readonly author_association?: string;
4551245512
readonly body?: string | null;
4551345513
readonly closed_at: string | null;
@@ -45517,13 +45517,13 @@ export type components = {
4551745517
readonly events_url?: string;
4551845518
readonly html_url?: string;
4551945519
readonly id?: number;
45520-
readonly labels?: readonly Record<string, never>[];
45520+
readonly labels?: readonly (Record<string, never> | null)[];
4552145521
readonly labels_url?: string;
4552245522
readonly locked?: boolean;
45523-
readonly milestone?: Record<string, never>;
45523+
readonly milestone?: Record<string, never> | null;
4552445524
readonly node_id?: string;
4552545525
readonly number?: number;
45526-
readonly performed_via_github_app?: Record<string, never>;
45526+
readonly performed_via_github_app?: Record<string, never> | null;
4552745527
readonly reactions?: {
4552845528
readonly "+1"?: number;
4552945529
readonly "-1"?: number;
@@ -51485,8 +51485,8 @@ export type components = {
5148551485
readonly body?: string | Record<string, never>;
5148651486
readonly body_html?: string;
5148751487
readonly container_metadata?: {
51488-
readonly labels?: Record<string, never>;
51489-
readonly manifest?: Record<string, never>;
51488+
readonly labels?: Record<string, never> | null;
51489+
readonly manifest?: Record<string, never> | null;
5149051490
readonly tag?: {
5149151491
readonly digest?: string;
5149251492
readonly name?: string;
@@ -51511,19 +51511,19 @@ export type components = {
5151151511
readonly name?: string;
5151251512
readonly version?: string;
5151351513
readonly npm_user?: string;
51514-
readonly author?: Record<string, never>;
51515-
readonly bugs?: Record<string, never>;
51514+
readonly author?: Record<string, never> | null;
51515+
readonly bugs?: Record<string, never> | null;
5151651516
readonly dependencies?: Record<string, never>;
5151751517
readonly dev_dependencies?: Record<string, never>;
5151851518
readonly peer_dependencies?: Record<string, never>;
5151951519
readonly optional_dependencies?: Record<string, never>;
5152051520
readonly description?: string;
51521-
readonly dist?: Record<string, never>;
51521+
readonly dist?: Record<string, never> | null;
5152251522
readonly git_head?: string;
5152351523
readonly homepage?: string;
5152451524
readonly license?: string;
5152551525
readonly main?: string;
51526-
readonly repository?: Record<string, never>;
51526+
readonly repository?: Record<string, never> | null;
5152751527
readonly scripts?: Record<string, never>;
5152851528
readonly id?: string;
5152951529
readonly node_version?: string;
@@ -51536,7 +51536,7 @@ export type components = {
5153651536
readonly files?: readonly string[];
5153751537
readonly bin?: Record<string, never>;
5153851538
readonly man?: Record<string, never>;
51539-
readonly directories?: Record<string, never>;
51539+
readonly directories?: Record<string, never> | null;
5154051540
readonly os?: readonly string[];
5154151541
readonly cpu?: readonly string[];
5154251542
readonly readme?: string;
@@ -80599,8 +80599,8 @@ export type components = {
8059980599
readonly body?: string | Record<string, never>;
8060080600
readonly body_html?: string;
8060180601
readonly container_metadata?: {
80602-
readonly labels?: Record<string, never>;
80603-
readonly manifest?: Record<string, never>;
80602+
readonly labels?: Record<string, never> | null;
80603+
readonly manifest?: Record<string, never> | null;
8060480604
readonly tag?: {
8060580605
readonly digest?: string;
8060680606
readonly name?: string;
@@ -80863,7 +80863,7 @@ export type components = {
8086380863
readonly updated_at: string;
8086480864
readonly version: string;
8086580865
};
80866-
readonly registry: Record<string, never>;
80866+
readonly registry: Record<string, never> | null;
8086780867
readonly updated_at: string;
8086880868
};
8086980869
readonly repository?: components["schemas"]["repository-webhooks"];
@@ -83470,7 +83470,7 @@ export type components = {
8347083470
readonly head_branch?: string | null;
8347183471
/** @description The name of the workflow. */
8347283472
readonly workflow_name?: string | null;
83473-
readonly steps?: readonly Record<string, never>[];
83473+
readonly steps?: readonly (Record<string, never> | null)[];
8347483474
readonly url?: string;
8347583475
};
8347683476
readonly deployment?: components["schemas"]["deployment"];

0 commit comments

Comments
 (0)