File tree 4 files changed +8
-4
lines changed
4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
All notable changes to this project will be documented in this file.
3
3
4
+ ## [ 0.20.1] - 2022-02-25
5
+ ### Fixed
6
+ - Support enums with single quotes in names for V2
7
+
4
8
## [ 0.20.0] - 2022-02-25
5
9
### Fixed
6
10
- Updated dependencies
7
- - Support enums with single quotes in names
11
+ - Support enums with single quotes in names for V3
8
12
- Generating better names when ` operationId ` is not given (breaking change)
9
13
- Fixed issue where ` x-enum ` flags where breaking due to non-string values
10
14
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " openapi-typescript-codegen" ,
3
- "version" : " 0.20.0 " ,
3
+ "version" : " 0.20.1 " ,
4
4
"description" : " Library that generates Typescript clients based on the OpenAPI specification." ,
5
5
"author" : " Ferdi Koomen" ,
6
6
"homepage" : " https://github.com/ferdikoomen/openapi-typescript-codegen" ,
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export const getEnum = (values?: (string | number)[]): Enum[] => {
23
23
. replace ( / ^ ( \d + ) / g, '_$1' )
24
24
. replace ( / ( [ a - z ] ) ( [ A - Z ] + ) / g, '$1_$2' )
25
25
. toUpperCase ( ) ,
26
- value : `'${ value } '` ,
26
+ value : `'${ value . replace ( / ' / g , "\\'" ) } '` ,
27
27
type : 'string' ,
28
28
description : null ,
29
29
} ;
Original file line number Diff line number Diff line change @@ -1000,7 +1000,7 @@ export enum EnumWithStrings {
1000
1000
/**
1001
1001
* null
1002
1002
*/
1003
- _SINGLE_QUOTE_ = ''Single Quote'',
1003
+ _SINGLE_QUOTE_ = '\\\\ 'Single Quote\\\\ '',
1004
1004
/**
1005
1005
* null
1006
1006
*/
You can’t perform that action at this time.
0 commit comments