bcherny/json-schema-to-typescript

Option for adding `undefined` to optional union for optional properties.

Open

#604 geöffnet am 23. Juni 2024

Auf GitHub ansehen
 (4 Kommentare) (1 Reaktion) (0 zugewiesene Personen)TypeScript (449 Forks)github user discovery
enhancementgood first issuehelp wanted

Repository-Metriken

Stars
 (3.302 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

In TypeScript, when exactOptionalPropertyTypes is set to true, properties that are optional?: but not do not include | undefined in their union can not be assigned a value of undefined.

For generating code that will be consumed by others, we may not want to force them to turn off exactOptionalPropertyTypes. For that please consider an option to include undefined in generated type unions of non-required properties.

Contributor Guide