acacode / acacode/swagger-typescript-api

anyOf produces redundant type

オープン
#341 コメント 1 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
4.1k
フォーク
436
PR マージ指標
30日以内にマージされた PR はありません

説明

I'm confused as to the purpose of this line of code: https://github.com/acacode/swagger-typescript-api/blob/5817a95706be4299b4afa76801e940bd62020742/src/schema.js#L210

It produces a type like:
```typescript
type Thing = A | B | C | (A & B & C);
```

But this is the same as
```typescript
type Thing = A | B | C;
```
Anything that is `A & B & C` must also be one of `A`, `B`, or `C`.

It seems like this just makes the type harder to read?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。