acacode / acacode/swagger-typescript-api

Object additionalProperties incorrect with anyOf

Ouverte
#469 0 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
bug
Langage dominant
TypeScript
Étoiles
4.1k
Forks
436
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

I am trying to define a schema mapping to `Record` with the following schema snippet:

```ts
type: object
additionalDetails:
type: object
description: Additional properties
additionalProperties:
anyOf:
- type: string
- type: number
- type: array
items:
type: string
```

However swagger-typescript-api seems to be ignoring `anyOf` and is just generating a signature based on the last element in the array, rather than generating a union of the listed types.

```ts
additionalDetails?: Record;
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.