acacode / acacode/swagger-typescript-api
allOf fails on enums
- Dominant language
- TypeScript
- Stars
- 4.1k
- Forks
- 436
- PR merge metrics
- No merged PRs in 30d
Description
The following code:
```yaml
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:
```ts
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:
```ts
export declare type Even = Digit & ('zero' | 'two' | 'four' | 'six' | 'eight');
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.