openapi-ts / openapi-typescript

Generate TypeScript types from OpenAPI 3 specs
https://openapi-ts.dev
MIT License
5.87k stars 468 forks source link

[string, null] definition is converted to unknown #969

Closed LarsOlt closed 2 years ago

LarsOlt commented 2 years ago

Description

Source: image

Output:

image

Expected:

"image-path": string | null

Name Version
openapi-typescript 5.4.1
Node.js 16.18.0
OS + version Win 11

Reproduction

How can this be reproduced / when did the error occur?

I am using the https://developers.themoviedb.org/ OAS API definition.

npx openapi-typescript https://api.stoplight.io/v1/versions/9WaNJfGpnnQ76opqe/export/oas.json --output tmdb-oas.ts

Expected result

(in case it’s not obvious)

Checklist

LarsOlt commented 2 years ago

Seems to be related to https://github.com/drwpow/openapi-typescript/issues/898 ?

drwpow commented 2 years ago

Thank you for raising! v6 will add OpenAPI 3.1 support so will make sure this makes it in.