acacode / acacode/swagger-typescript-api

anyOf produces redundant type

Abierto
#341 1 comentario 2 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
4.1k
Forks
436
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.