acacode / acacode/swagger-typescript-api

Object additionalProperties incorrect with anyOf

Offen
#469 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
TypeScript
Sterne
4.1k
Forks
436
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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;
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.