openapi-ts
openapi-ts copied to clipboard
Generated type for an enum in a schema with single quote does not escape properly
Description
Single quotes in an enum in a schema do not escape properly so it breaks the generated type.
Expected
export type SomeRequest = {
category: 'Category A' | 'Category B' | 'Category C';
withSingleQuote: 'Yes' | 'No' | "Don't Know";
}
Actual
export type SomeRequest = {
category: 'Category A' | 'Category B' | 'Category C';
withSingleQuote: 'Yes' | 'No' | 'Don't Know';
}
Reproducible example or configuration
No response
OpenAPI specification (optional)
components:
schemas:
...
SomeRequest:
type: object
properties:
category:
type: string
enum:
- Category A
- Category B
- Category C
withSingleQuote:
type: string
enum:
- Yes
- No
- Don't Know
System information (optional)
No response