-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle nullable enums in experimental parser
- Loading branch information
Showing
13 changed files
with
156 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@hey-api/openapi-ts': patch | ||
--- | ||
|
||
fix: handle nullable enums in experimental parser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/openapi-ts/test/__snapshots__/3.0.x/enum-null/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// This file is auto-generated by @hey-api/openapi-ts | ||
export * from './types.gen'; |
7 changes: 7 additions & 0 deletions
7
packages/openapi-ts/test/__snapshots__/3.0.x/enum-null/types.gen.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// This file is auto-generated by @hey-api/openapi-ts | ||
|
||
export type Foo = 'foo' | 'bar' | null; | ||
|
||
export type Bar = 'foo' | 'bar'; | ||
|
||
export type Baz = 'foo' | 'bar'; |
2 changes: 2 additions & 0 deletions
2
packages/openapi-ts/test/__snapshots__/3.1.x/enum-null/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// This file is auto-generated by @hey-api/openapi-ts | ||
export * from './types.gen'; |
7 changes: 7 additions & 0 deletions
7
packages/openapi-ts/test/__snapshots__/3.1.x/enum-null/types.gen.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// This file is auto-generated by @hey-api/openapi-ts | ||
|
||
export type Foo = 'foo' | 'bar' | null; | ||
|
||
export type Bar = 'foo' | 'bar'; | ||
|
||
export type Baz = 'foo' | 'bar'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"openapi": "3.0.2", | ||
"info": { | ||
"title": "OpenAPI 3.0.2 enum null example", | ||
"version": "1" | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Foo": { | ||
"enum": ["foo", "bar", null], | ||
"nullable": true, | ||
"type": "string" | ||
}, | ||
"Bar": { | ||
"enum": ["foo", "bar", null], | ||
"type": "string" | ||
}, | ||
"Baz": { | ||
"enum": ["foo", "bar"], | ||
"nullable": true, | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"title": "OpenAPI 3.1.0 enum null example", | ||
"version": "1" | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Foo": { | ||
"enum": ["foo", "bar", null], | ||
"type": ["string", "null"] | ||
}, | ||
"Bar": { | ||
"enum": ["foo", "bar", null], | ||
"type": "string" | ||
}, | ||
"Baz": { | ||
"enum": ["foo", "bar"], | ||
"type": ["string", "null"] | ||
} | ||
} | ||
} | ||
} |