Skip to content
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

If all parameters are optional, make the top level object optional too #2044

Open
Stono opened this issue Feb 20, 2024 · 4 comments
Open

If all parameters are optional, make the top level object optional too #2044

Stono opened this issue Feb 20, 2024 · 4 comments

Comments

@Stono
Copy link

Stono commented Feb 20, 2024

When you have a single option, that's optional (for example namespace here), it'd be good if the whole options object was optional.

Currently you have to do .list({})

    public list({
        namespace,
    }: {
        namespace?: string,
    }): CancelablePromise<ListJobsResponse> 
@mrlubos
Copy link
Collaborator

mrlubos commented Feb 21, 2024

@Stono I had a look at this, it's not going to be a small change set. You'd need to create a separate type for the whole options object, make it optional, and destructure inside the function body. That being said, I will let you know if I have any updates

@mrlubos
Copy link
Collaborator

mrlubos commented Mar 3, 2024

@Stono this feature is available in our fork, please let me know if it works as expected!

@Stono
Copy link
Author

Stono commented Mar 4, 2024

Oh, amazing @mrlubos - i'll give that a go, thank you

@mrlubos
Copy link
Collaborator

mrlubos commented Mar 7, 2024

@Stono got rid of generics by default as they were a breaking change with other libraries. If you want them, the command is

openapi --serviceResponse generics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants