openapi-typescript
openapi-typescript copied to clipboard
`--properties-required-by-default` and `--default-non-nullable` flags do not work
Description
The --properties-required-by-default
and --default-non-nullable
flags do not work. If you include these flag in the CLI, the execution hangs forever. From this issue it also seems like the same thing is happening with --path-params-as-types
. If you remove these flags, the execution works fine.
Name | Version |
---|---|
openapi-typescript |
6.7.5 |
Node.js | 18.18.2 |
OS + version | macOS 14.0 |
Reproduction
Run any generation command with --properties-required-by-default
, --default-non-nullable
or --path-params-as-types
flags, and you will see the execution hangs.
Checklist
- [x] My OpenAPI schema passes the Redocly validator (
npx @redocly/cli@latest lint
) - [ ] I’m willing to open a PR (see CONTRIBUTING.md)
I tried 7.0.0-next.11 in the hopes of this being fixed in the new version, but same problem. Is there an older version where this works?
This is still not working for 7.0.0-rc.0
Is anyone able to provide a reproduction of this issue? We have tests for both that test they’re working that are both passing.
In 7.0.1 I'm experiencing a related issue - the option -properties-required-by-default has no effect. It doesn't hang the CLI as in the original comment. I'm also experiencing https://github.com/openapi-ts/openapi-typescript/issues/1467 even the required fields are optional
"DeviceDto": {
"type": "object",
"properties": {
"deviceId": {
"type": "string",
"format": "uuid",
"required": true
},
"name": {
"type": "string",
},
outputs:
DeviceDto: {
/** Format: uuid */
deviceId?: string;
name?: string;
}