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

PUT/DELETE/POST methods without body generates unused code when generating for SWR #1261

Closed
AffeJonsson opened this issue Mar 14, 2024 · 2 comments · Fixed by #1263
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@AffeJonsson
Copy link
Contributor

AffeJonsson commented Mar 14, 2024

What are the steps to reproduce this issue?

  1. Add a PUT method without body, e.g. api/profile/acceptTerms
  2. Generate hooks for SWR client

What happens?

Code generated has unused parameters.

export const getPutProfileAcceptTermsMutationFetcher = () => {
  return (_: string, { arg }: { arg: Arguments }): Promise<void> => {
                   //   ^ here is the unused parameter.
    return putProfileAcceptTerms();
  };
};

What were you expecting to happen?

Unused code should not be generated

Any other comments?

Here is the code adding this part of the generated code.

return (_: string, { arg }: { arg: Arguments }): ${swrMutationFetcherType} => {

What versions are you using?

Operating System: Windows 11
Package Version: Orval version 6.25.0

@AffeJonsson AffeJonsson changed the title PUT methods without body generates unused code when generating for SWR PUT/DELETE/POST methods without body generates unused code when generating for SWR Mar 14, 2024
@melloware
Copy link
Collaborator

PR is welcome?

@melloware melloware added the bug Something isn't working label Mar 14, 2024
@AffeJonsson
Copy link
Contributor Author

I'll fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants