acacode / acacode/swagger-typescript-api

anyOf produces redundant type

Aberta
#341 1 comentário 2 reações 0 responsáveis Ver no GitHub
Linguagem predominante
TypeScript
Estrelas
4.1k
Forks
436
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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?

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.