Skip to content

Commit 7db9f87

Browse files
committed
Fix nullable + enum
1 parent 5b97fb8 commit 7db9f87

File tree

6 files changed

+281
-263
lines changed

6 files changed

+281
-263
lines changed

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

+35-35
Original file line numberDiff line numberDiff line change
@@ -19076,7 +19076,7 @@ export type components = {
1907619076
* @description The execution scope of the vulnerable dependency.
1907719077
* @enum {string|null}
1907819078
*/
19079-
readonly scope?: "development" | "runtime";
19079+
readonly scope?: "development" | "runtime" | null;
1908019080
};
1908119081
readonly security_advisory: components["schemas"]["dependabot-alert-security-advisory"];
1908219082
readonly security_vulnerability: components["schemas"]["dependabot-alert-security-vulnerability"];
@@ -19090,7 +19090,7 @@ export type components = {
1909019090
* @description The reason that the alert was dismissed.
1909119091
* @enum {string|null}
1909219092
*/
19093-
readonly dismissed_reason: "fix_started" | "inaccurate" | "no_bandwidth" | "not_used" | "tolerable_risk";
19093+
readonly dismissed_reason: "fix_started" | "inaccurate" | "no_bandwidth" | "not_used" | "tolerable_risk" | null;
1909419094
/** @description An optional comment associated with the alert's dismissal. */
1909519095
readonly dismissed_comment: string | null;
1909619096
readonly fixed_at: components["schemas"]["alert-fixed-at"];
@@ -19111,7 +19111,7 @@ export type components = {
1911119111
* @description **Required when the `state` is `resolved`.** The reason for resolving the alert.
1911219112
* @enum {string|null}
1911319113
*/
19114-
readonly "secret-scanning-alert-resolution": "false_positive" | "wont_fix" | "revoked" | "used_in_tests";
19114+
readonly "secret-scanning-alert-resolution": "false_positive" | "wont_fix" | "revoked" | "used_in_tests" | null;
1911519115
readonly "organization-secret-scanning-alert": {
1911619116
readonly number?: components["schemas"]["alert-number"];
1911719117
readonly created_at?: components["schemas"]["alert-created-at"];
@@ -19379,7 +19379,7 @@ export type components = {
1937919379
* @example not_planned
1938019380
* @enum {string|null}
1938119381
*/
19382-
readonly state_reason?: "completed" | "reopened" | "not_planned";
19382+
readonly state_reason?: "completed" | "reopened" | "not_planned" | null;
1938319383
/**
1938419384
* @description Title of the issue
1938519385
* @example Widget creation fails in Safari on OS X 10.8
@@ -20920,12 +20920,12 @@ export type components = {
2092020920
* @description The severity of the alert.
2092120921
* @enum {string|null}
2092220922
*/
20923-
readonly severity?: "none" | "note" | "warning" | "error";
20923+
readonly severity?: "none" | "note" | "warning" | "error" | null;
2092420924
/**
2092520925
* @description The security severity of the alert.
2092620926
* @enum {string|null}
2092720927
*/
20928-
readonly security_severity_level?: "low" | "medium" | "high" | "critical";
20928+
readonly security_severity_level?: "low" | "medium" | "high" | "critical" | null;
2092920929
/** @description A short description of the rule used to detect the alert. */
2093020930
readonly description?: string;
2093120931
};
@@ -20957,7 +20957,7 @@ export type components = {
2095720957
* @description A classification of the file. For example to identify it as generated.
2095820958
* @enum {string|null}
2095920959
*/
20960-
readonly "code-scanning-alert-classification": "source" | "generated" | "test" | "library";
20960+
readonly "code-scanning-alert-classification": "source" | "generated" | "test" | "library" | null;
2096120961
readonly "code-scanning-alert-instance": {
2096220962
readonly ref?: components["schemas"]["code-scanning-ref"];
2096320963
readonly analysis_key?: components["schemas"]["code-scanning-analysis-analysis-key"];
@@ -21032,7 +21032,7 @@ export type components = {
2103221032
* @example ready
2103321033
* @enum {string|null}
2103421034
*/
21035-
readonly prebuild_availability: "none" | "ready" | "in_progress";
21035+
readonly prebuild_availability: "none" | "ready" | "in_progress" | null;
2103621036
} | null;
2103721037
/**
2103821038
* Codespace
@@ -22235,7 +22235,7 @@ export type components = {
2223522235
* @example org_actors
2223622236
* @enum {string|null}
2223722237
*/
22238-
readonly values_editable_by?: "org_actors" | "org_and_repo_actors";
22238+
readonly values_editable_by?: "org_actors" | "org_and_repo_actors" | null;
2223922239
};
2224022240
/**
2224122241
* Custom Property Value
@@ -23533,7 +23533,7 @@ export type components = {
2353323533
* @description The severity of the advisory.
2353423534
* @enum {string|null}
2353523535
*/
23536-
readonly severity: "critical" | "high" | "medium" | "low";
23536+
readonly severity: "critical" | "high" | "medium" | "low" | null;
2353723537
/** @description The author of the advisory. */
2353823538
readonly author: components["schemas"]["simple-user"] | null;
2353923539
/** @description The publisher of the advisory. */
@@ -24695,7 +24695,7 @@ export type components = {
2469524695
* @example success
2469624696
* @enum {string|null}
2469724697
*/
24698-
readonly conclusion: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required";
24698+
readonly conclusion: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | null;
2469924699
/**
2470024700
* Format: date-time
2470124701
* @description The time that the job created, in ISO 8601 format.
@@ -26031,7 +26031,7 @@ export type components = {
2603126031
* @example neutral
2603226032
* @enum {string|null}
2603326033
*/
26034-
readonly conclusion: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required";
26034+
readonly conclusion: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | null;
2603526035
/**
2603626036
* Format: date-time
2603726037
* @example 2018-05-04T01:14:52Z
@@ -26161,7 +26161,7 @@ export type components = {
2616126161
* @example completed
2616226162
* @enum {string|null}
2616326163
*/
26164-
readonly status: "queued" | "in_progress" | "completed" | "waiting" | "requested" | "pending";
26164+
readonly status: "queued" | "in_progress" | "completed" | "waiting" | "requested" | "pending" | null;
2616526165
/**
2616626166
* @example neutral
2616726167
* @enum {string|null}
@@ -26225,12 +26225,12 @@ export type components = {
2622526225
* @description The severity of the alert.
2622626226
* @enum {string|null}
2622726227
*/
26228-
readonly severity?: "none" | "note" | "warning" | "error";
26228+
readonly severity?: "none" | "note" | "warning" | "error" | null;
2622926229
/**
2623026230
* @description The security severity of the alert.
2623126231
* @enum {string|null}
2623226232
*/
26233-
readonly security_severity_level?: "low" | "medium" | "high" | "critical";
26233+
readonly security_severity_level?: "low" | "medium" | "high" | "critical" | null;
2623426234
/** @description A short description of the rule used to detect the alert. */
2623526235
readonly description?: string;
2623626236
/** @description description of the rule used to detect the alert. */
@@ -26382,7 +26382,7 @@ export type components = {
2638226382
* @description The frequency of the periodic analysis.
2638326383
* @enum {string|null}
2638426384
*/
26385-
readonly schedule?: "weekly";
26385+
readonly schedule?: "weekly" | null;
2638626386
};
2638726387
/** @description Configuration for code scanning default setup. */
2638826388
readonly "code-scanning-default-setup-update": {
@@ -26523,7 +26523,7 @@ export type components = {
2652326523
* @example ready
2652426524
* @enum {string|null}
2652526525
*/
26526-
readonly prebuild_availability: "none" | "ready" | "in_progress";
26526+
readonly prebuild_availability: "none" | "ready" | "in_progress" | null;
2652726527
};
2652826528
/**
2652926529
* Codespaces Permissions Check
@@ -27376,7 +27376,7 @@ export type components = {
2737627376
* @description The execution scope of the vulnerable dependency.
2737727377
* @enum {string|null}
2737827378
*/
27379-
readonly scope?: "development" | "runtime";
27379+
readonly scope?: "development" | "runtime" | null;
2738027380
};
2738127381
readonly security_advisory: components["schemas"]["dependabot-alert-security-advisory"];
2738227382
readonly security_vulnerability: components["schemas"]["dependabot-alert-security-vulnerability"];
@@ -27390,7 +27390,7 @@ export type components = {
2739027390
* @description The reason that the alert was dismissed.
2739127391
* @enum {string|null}
2739227392
*/
27393-
readonly dismissed_reason: "fix_started" | "inaccurate" | "no_bandwidth" | "not_used" | "tolerable_risk";
27393+
readonly dismissed_reason: "fix_started" | "inaccurate" | "no_bandwidth" | "not_used" | "tolerable_risk" | null;
2739427394
/** @description An optional comment associated with the alert's dismissal. */
2739527395
readonly dismissed_comment: string | null;
2739627396
readonly fixed_at: components["schemas"]["alert-fixed-at"];
@@ -28332,7 +28332,7 @@ export type components = {
2833228332
* @example not_planned
2833328333
* @enum {string|null}
2833428334
*/
28335-
readonly state_reason?: "completed" | "reopened" | "not_planned";
28335+
readonly state_reason?: "completed" | "reopened" | "not_planned" | null;
2833628336
/**
2833728337
* @description Title of the issue
2833828338
* @example Widget creation fails in Safari on OS X 10.8
@@ -29148,7 +29148,7 @@ export type components = {
2914829148
* @default RIGHT
2914929149
* @enum {string|null}
2915029150
*/
29151-
readonly start_side: "LEFT" | "RIGHT";
29151+
readonly start_side: "LEFT" | "RIGHT" | null;
2915229152
/**
2915329153
* @description The line of the blob to which the comment applies. The last line of the range for a multi-line comment
2915429154
* @example 2
@@ -29420,7 +29420,7 @@ export type components = {
2942029420
* @example built
2942129421
* @enum {string|null}
2942229422
*/
29423-
readonly status: "built" | "building" | "errored";
29423+
readonly status: "built" | "building" | "errored" | null;
2942429424
/**
2942529425
* @description The Pages site's custom domain
2942629426
* @example example.com
@@ -29431,7 +29431,7 @@ export type components = {
2943129431
* @example pending
2943229432
* @enum {string|null}
2943329433
*/
29434-
readonly protected_domain_state?: "pending" | "verified" | "unverified";
29434+
readonly protected_domain_state?: "pending" | "verified" | "unverified" | null;
2943529435
/**
2943629436
* Format: date-time
2943729437
* @description The timestamp when a pending domain becomes unverified.
@@ -29454,7 +29454,7 @@ export type components = {
2945429454
* @example legacy
2945529455
* @enum {string|null}
2945629456
*/
29457-
readonly build_type?: "legacy" | "workflow";
29457+
readonly build_type?: "legacy" | "workflow" | null;
2945829458
readonly source?: components["schemas"]["pages-source-hash"];
2945929459
/**
2946029460
* @description Whether the GitHub Pages site is publicly visible. If set to `true`, the site is accessible to anyone on the internet. If set to `false`, the site will only be accessible to users who have at least `read` access to the repository that published the site.
@@ -30255,7 +30255,7 @@ export type components = {
3025530255
* @default RIGHT
3025630256
* @enum {string|null}
3025730257
*/
30258-
readonly start_side: "LEFT" | "RIGHT";
30258+
readonly start_side: "LEFT" | "RIGHT" | null;
3025930259
/**
3026030260
* @description The line of the blob to which the comment applies. The last line of the range for a multi-line comment
3026130261
* @example 2
@@ -30649,7 +30649,7 @@ export type components = {
3064930649
* @description The severity of the advisory. You must choose between setting this field or `cvss_vector_string`.
3065030650
* @enum {string|null}
3065130651
*/
30652-
readonly severity?: "critical" | "high" | "medium" | "low";
30652+
readonly severity?: "critical" | "high" | "medium" | "low" | null;
3065330653
/** @description The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`. */
3065430654
readonly cvss_vector_string?: string | null;
3065530655
/**
@@ -30684,7 +30684,7 @@ export type components = {
3068430684
* @description The severity of the advisory. You must choose between setting this field or `cvss_vector_string`.
3068530685
* @enum {string|null}
3068630686
*/
30687-
readonly severity?: "critical" | "high" | "medium" | "low";
30687+
readonly severity?: "critical" | "high" | "medium" | "low" | null;
3068830688
/** @description The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`. */
3068930689
readonly cvss_vector_string?: string | null;
3069030690
/**
@@ -30727,7 +30727,7 @@ export type components = {
3072730727
* @description The severity of the advisory. You must choose between setting this field or `cvss_vector_string`.
3072830728
* @enum {string|null}
3072930729
*/
30730-
readonly severity?: "critical" | "high" | "medium" | "low";
30730+
readonly severity?: "critical" | "high" | "medium" | "low" | null;
3073130731
/** @description The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`. */
3073230732
readonly cvss_vector_string?: string | null;
3073330733
/**
@@ -32614,7 +32614,7 @@ export type components = {
3261432614
* @example neutral
3261532615
* @enum {string|null}
3261632616
*/
32617-
readonly conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | "stale" | "startup_failure";
32617+
readonly conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | "stale" | "startup_failure" | null;
3261832618
/** Format: date-time */
3261932619
readonly created_at?: string;
3262032620
/** @example master */
@@ -32656,7 +32656,7 @@ export type components = {
3265632656
* @example neutral
3265732657
* @enum {string|null}
3265832658
*/
32659-
readonly conclusion: "waiting" | "pending" | "startup_failure" | "stale" | "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required";
32659+
readonly conclusion: "waiting" | "pending" | "startup_failure" | "stale" | "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | null;
3266032660
readonly deployment?: components["schemas"]["deployment-simple"];
3266132661
/** @example https://example.com */
3266232662
readonly details_url: string;
@@ -33022,7 +33022,7 @@ export type components = {
3302233022
* @example resolved
3302333023
* @enum {string|null}
3302433024
*/
33025-
readonly state_reason: "resolved" | "outdated" | "duplicate" | "reopened";
33025+
readonly state_reason: "resolved" | "outdated" | "duplicate" | "reopened" | null;
3302633026
readonly timeline_url?: string;
3302733027
readonly title: string;
3302833028
/** Format: date-time */
@@ -37053,7 +37053,7 @@ export type components = {
3705337053
* @description The reason for resolving the alert.
3705437054
* @enum {string|null}
3705537055
*/
37056-
readonly "secret-scanning-alert-resolution-webhook": "false_positive" | "wont_fix" | "revoked" | "used_in_tests" | "pattern_deleted" | "pattern_edited";
37056+
readonly "secret-scanning-alert-resolution-webhook": "false_positive" | "wont_fix" | "revoked" | "used_in_tests" | "pattern_deleted" | "pattern_edited" | null;
3705737057
readonly "secret-scanning-alert-webhook": {
3705837058
readonly number?: components["schemas"]["alert-number"];
3705937059
readonly created_at?: components["schemas"]["alert-created-at"];
@@ -82078,7 +82078,7 @@ export type components = {
8207882078
/** Format: uri */
8207982079
readonly check_suite_url: string;
8208082080
/** @enum {string|null} */
82081-
readonly conclusion: "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "stale" | "success" | "timed_out";
82081+
readonly conclusion: "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "stale" | "success" | "timed_out" | null;
8208282082
/** Format: date-time */
8208382083
readonly created_at: string;
8208482084
readonly event: string;
@@ -82531,7 +82531,7 @@ export type components = {
8253182531
/** Format: uri */
8253282532
readonly check_suite_url: string;
8253382533
/** @enum {string|null} */
82534-
readonly conclusion: "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "stale" | "success" | "timed_out";
82534+
readonly conclusion: "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "stale" | "success" | "timed_out" | null;
8253582535
/** Format: date-time */
8253682536
readonly created_at: string;
8253782537
readonly event: string;
@@ -104716,7 +104716,7 @@ export interface operations {
104716104716
* @example not_planned
104717104717
* @enum {string|null}
104718104718
*/
104719-
readonly state_reason?: "completed" | "not_planned" | "reopened";
104719+
readonly state_reason?: "completed" | "not_planned" | "reopened" | null;
104720104720
readonly milestone?: (string | number) | null;
104721104721
/** @description Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped. */
104722104722
readonly labels?: readonly (string | {

0 commit comments

Comments
 (0)