-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1326 from hey-api/fix/experimental-parser-enum-names
fix: improve generated enum keys in experimental parser
- Loading branch information
Showing
19 changed files
with
226 additions
and
12 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: improve generated enum keys 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
2 changes: 2 additions & 0 deletions
2
packages/openapi-ts/test/__snapshots__/3.0.x/enum-names-javascript/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'; |
22 changes: 22 additions & 0 deletions
22
packages/openapi-ts/test/__snapshots__/3.0.x/enum-names-javascript/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,22 @@ | ||
// This file is auto-generated by @hey-api/openapi-ts | ||
|
||
export type _1_10 = '1-10' | '11-20'; | ||
|
||
export const _1_10 = { | ||
'1-10': '1-10', | ||
'11-20': '11-20' | ||
} as const; | ||
|
||
export type myFoo = 'myFoo' | 'myBar'; | ||
|
||
export const myFoo = { | ||
MY_FOO: 'myFoo', | ||
MY_BAR: 'myBar' | ||
} as const; | ||
|
||
export type MyFoo = 'MyFoo' | 'MyBar'; | ||
|
||
export const MyFoo = { | ||
MY_FOO: 'MyFoo', | ||
MY_BAR: 'MyBar' | ||
} as const; |
2 changes: 2 additions & 0 deletions
2
packages/openapi-ts/test/__snapshots__/3.0.x/enum-names-typescript/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'; |
16 changes: 16 additions & 0 deletions
16
packages/openapi-ts/test/__snapshots__/3.0.x/enum-names-typescript/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,16 @@ | ||
// This file is auto-generated by @hey-api/openapi-ts | ||
|
||
export enum _1_10 { | ||
'1-10' = '1-10', | ||
'11-20' = '11-20' | ||
} | ||
|
||
export enum myFoo { | ||
MY_FOO = 'myFoo', | ||
MY_BAR = 'myBar' | ||
} | ||
|
||
export enum MyFoo { | ||
MY_FOO = 'MyFoo', | ||
MY_BAR = 'MyBar' | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/openapi-ts/test/__snapshots__/3.0.x/enum-names/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-names/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 _1_10 = '1-10' | '11-20'; | ||
|
||
export type myFoo = 'myFoo' | 'myBar'; | ||
|
||
export type MyFoo = 'MyFoo' | 'MyBar'; |
2 changes: 2 additions & 0 deletions
2
packages/openapi-ts/test/__snapshots__/3.1.x/enum-names-javascript/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'; |
22 changes: 22 additions & 0 deletions
22
packages/openapi-ts/test/__snapshots__/3.1.x/enum-names-javascript/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,22 @@ | ||
// This file is auto-generated by @hey-api/openapi-ts | ||
|
||
export type _1_10 = '1-10' | '11-20'; | ||
|
||
export const _1_10 = { | ||
'1-10': '1-10', | ||
'11-20': '11-20' | ||
} as const; | ||
|
||
export type myFoo = 'myFoo' | 'myBar'; | ||
|
||
export const myFoo = { | ||
MY_FOO: 'myFoo', | ||
MY_BAR: 'myBar' | ||
} as const; | ||
|
||
export type MyFoo = 'MyFoo' | 'MyBar'; | ||
|
||
export const MyFoo = { | ||
MY_FOO: 'MyFoo', | ||
MY_BAR: 'MyBar' | ||
} as const; |
2 changes: 2 additions & 0 deletions
2
packages/openapi-ts/test/__snapshots__/3.1.x/enum-names-typescript/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'; |
16 changes: 16 additions & 0 deletions
16
packages/openapi-ts/test/__snapshots__/3.1.x/enum-names-typescript/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,16 @@ | ||
// This file is auto-generated by @hey-api/openapi-ts | ||
|
||
export enum _1_10 { | ||
'1-10' = '1-10', | ||
'11-20' = '11-20' | ||
} | ||
|
||
export enum myFoo { | ||
MY_FOO = 'myFoo', | ||
MY_BAR = 'myBar' | ||
} | ||
|
||
export enum MyFoo { | ||
MY_FOO = 'MyFoo', | ||
MY_BAR = 'MyBar' | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/openapi-ts/test/__snapshots__/3.1.x/enum-names/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-names/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 _1_10 = '1-10' | '11-20'; | ||
|
||
export type myFoo = 'myFoo' | 'myBar'; | ||
|
||
export type MyFoo = 'MyFoo' | 'MyBar'; |
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,23 @@ | ||
{ | ||
"openapi": "3.0.2", | ||
"info": { | ||
"title": "OpenAPI 3.0.2 enum names example", | ||
"version": "1" | ||
}, | ||
"components": { | ||
"schemas": { | ||
"1-10": { | ||
"enum": ["1-10", "11-20"], | ||
"type": "string" | ||
}, | ||
"myFoo": { | ||
"enum": ["myFoo", "myBar"], | ||
"type": "string" | ||
}, | ||
"MyFoo": { | ||
"enum": ["MyFoo", "MyBar"], | ||
"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.1", | ||
"info": { | ||
"title": "OpenAPI 3.1.1 enum names example", | ||
"version": "1" | ||
}, | ||
"components": { | ||
"schemas": { | ||
"1-10": { | ||
"enum": ["1-10", "11-20"], | ||
"type": "string" | ||
}, | ||
"myFoo": { | ||
"enum": ["myFoo", "myBar"], | ||
"type": "string" | ||
}, | ||
"MyFoo": { | ||
"enum": ["MyFoo", "MyBar"], | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} |