openapi-typescript icon indicating copy to clipboard operation
openapi-typescript copied to clipboard

`--properties-required-by-default` and `--default-non-nullable` flags do not work

Open cekpowell opened this issue 9 months ago • 4 comments

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

cekpowell avatar May 01 '24 14:05 cekpowell

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?

magnattic avatar May 13 '24 19:05 magnattic

This is still not working for 7.0.0-rc.0

f-ricci avatar Jun 13 '24 13:06 f-ricci

Is anyone able to provide a reproduction of this issue? We have tests for both that test they’re working that are both passing.

drwpow avatar Jun 24 '24 15:06 drwpow

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;
}

rumyanar avatar Jul 03 '24 13:07 rumyanar