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
Extra