swagger-typescript-api
swagger-typescript-api copied to clipboard
allOf fails on enums
The following code:
components:
schemas:
Digit:
type: string
enum:
- zero
- one
- two
- three
- four
- five
- six
- seven
- eight
- nine
Even:
allOf:
- $ref: '#/components/schemas/Digit'
- type: string
enum:
- zero
- two
- four
- six
- eight
Compiles to:
export declare type Digit =
| 'zero'
| 'one'
| 'two'
| 'three'
| 'four'
| 'five'
| 'six'
| 'seven'
| 'eight'
| 'nine';
export declare type Even = (Digit & 'zero') | 'two' | 'four' | 'six' | 'eight';
Even should be:
export declare type Even = Digit & ('zero' | 'two' | 'four' | 'six' | 'eight');