-
-
Notifications
You must be signed in to change notification settings - Fork 617
Open
Labels
bugSomething isn't workingSomething isn't workingopenapi-tsRelevant to the openapi-typescript libraryRelevant to the openapi-typescript library
Description
openapi-typescript version
7.0.2
Node.js version
22
OS + version
15.8
Description
Problem
OpenAPI defines types observed over the wire, but the generated optional types do not match. Specifically, optional types are defined as optional in typescript, versus null
Reproduction
- Define a schema:
Demo: { type: "object", properties: { foo: { ... }, bar: { ... } } - Generate typescript:
3. actual:{ Demo: { foo?: number, bar?: number }
Expected result
{ Demo: { foo: number | null, bar: number | null }
I expected null
Required
- My OpenAPI schema is valid and passes the Redocly validator (
npx @redocly/cli@latest lint)
Extra
- I’m willing to open a PR (see CONTRIBUTING.md)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingopenapi-tsRelevant to the openapi-typescript libraryRelevant to the openapi-typescript library