acacode / acacode/swagger-typescript-api

allOf fails on enums

Open
#324 0 comments 0 reactions 0 assignees View on GitHub
bug
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.