Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 2 tasks
cekpowell opened this issue May 1, 2024 · 7 comments
Open
1 of 2 tasks
Assignees
Labels
openapi-ts Relevant to the openapi-typescript library question Further information is requested

Comments

@cekpowell
Copy link

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 cekpowell added bug Something isn't working openapi-ts Relevant to the openapi-typescript library labels May 1, 2024
@magnattic
Copy link

magnattic commented May 13, 2024

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?

@f-ricci
Copy link

f-ricci commented Jun 13, 2024

This is still not working for 7.0.0-rc.0

@drwpow
Copy link
Contributor

drwpow commented Jun 24, 2024

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 drwpow added question Further information is requested and removed bug Something isn't working labels Jun 24, 2024
@rumyanar
Copy link

rumyanar commented Jul 3, 2024

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

Copy link
Contributor

github-actions bot commented Oct 2, 2024

This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

@github-actions github-actions bot added the stale label Oct 2, 2024
@magnattic
Copy link

Just tried it with 7.4.1 and both flags work for me. I think this can be closed.

@github-actions github-actions bot removed the stale label Oct 3, 2024
@stefcameron
Copy link

In 7.4.3, the --path-params-as-types (also mentioned in the description, but not the title, of this issue) still results in the CLI hanging forever without doing anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openapi-ts Relevant to the openapi-typescript library question Further information is requested
Projects
None yet
Development

No branches or pull requests

7 participants