mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
Fixed enum for V2
Bumped version
This commit is contained in:
parent
9fb432968a
commit
fec6534b91
@ -1,10 +1,14 @@
|
||||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [0.20.1] - 2022-02-25
|
||||
### Fixed
|
||||
- Support enums with single quotes in names for V2
|
||||
|
||||
## [0.20.0] - 2022-02-25
|
||||
### Fixed
|
||||
- Updated dependencies
|
||||
- Support enums with single quotes in names
|
||||
- Support enums with single quotes in names for V3
|
||||
- Generating better names when `operationId` is not given (breaking change)
|
||||
- Fixed issue where `x-enum` flags where breaking due to non-string values
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openapi-typescript-codegen",
|
||||
"version": "0.20.0",
|
||||
"version": "0.20.1",
|
||||
"description": "Library that generates Typescript clients based on the OpenAPI specification.",
|
||||
"author": "Ferdi Koomen",
|
||||
"homepage": "https://github.com/ferdikoomen/openapi-typescript-codegen",
|
||||
|
||||
@ -23,7 +23,7 @@ export const getEnum = (values?: (string | number)[]): Enum[] => {
|
||||
.replace(/^(\d+)/g, '_$1')
|
||||
.replace(/([a-z])([A-Z]+)/g, '$1_$2')
|
||||
.toUpperCase(),
|
||||
value: `'${value}'`,
|
||||
value: `'${value.replace(/'/g, "\\'")}'`,
|
||||
type: 'string',
|
||||
description: null,
|
||||
};
|
||||
|
||||
@ -1000,7 +1000,7 @@ export enum EnumWithStrings {
|
||||
/**
|
||||
* null
|
||||
*/
|
||||
_SINGLE_QUOTE_ = ''Single Quote'',
|
||||
_SINGLE_QUOTE_ = '\\\\'Single Quote\\\\'',
|
||||
/**
|
||||
* null
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user