openapi-react-query-codegen icon indicating copy to clipboard operation
openapi-react-query-codegen copied to clipboard

"--operationId" still includes service name

Open maxoosterveen opened this issue 1 year ago • 4 comments

Describe the bug When running the generator command with the option --operationId still includes the service names in the hooks

To Reproduce Steps to reproduce the behavior: pnpm exec openapi-rq -i ./internal.json --operationId

OpenAPI spec file If possible, please upload the OpenAPI spec file.

Expected behavior A clear and concise description of what you expected to happen. Instead of having the service name in the function hook, I would like it to only use the operation id. useServiceNameOperationId > useOperationId

Screenshots If applicable, add screenshots or logs to help explain your problem.

  • OS: [e.g. macOS]
  • macOS
  • Version [e.g. v1.0.0]
  • 1.4.1

Additional context Add any other context about the problem here.

maxoosterveen avatar Jul 23 '24 07:07 maxoosterveen

@maxoosterveen Thank you for the report. The --operationId is an option from @hey-api/openapi-ts, but it seems we haven't been able to pass it correctly from our library. I will fix it.

7nohe avatar Aug 06 '24 15:08 7nohe

This is blocking for me on migrating over - any pointers on where to start looking?

JoeHillyard avatar Sep 22 '24 21:09 JoeHillyard

@maxoosterveen @JoeHillyard Sorry for the delayed response. The issue has been fixed in #151. A pre-release version has been published, so you can test it by installing the following version.

npm i -D @7nohe/openapi-react-query-codegen@0.0.0-ef2157e65a33494afbc157e7e72b47353a84e49a

If there are no issues, I will merge this PR and release it.

7nohe avatar Sep 24 '24 13:09 7nohe

Hmm i don't seem to be having any luck - service name is still coming through

JoeHillyard avatar Sep 27 '24 18:09 JoeHillyard

Same - still getting service names when using version 0.0.0-ef2157e65a33494afbc157e7e72b47353a84e49a

nickdaugherty avatar Oct 12 '24 21:10 nickdaugherty

We have adopted Flat Services from version 2 to support tree-shaking, and as a result, service names have been deprecated.

7nohe avatar Oct 14 '24 07:10 7nohe

so? how to fix it? the reference to "Flat Services" is absolutely not helpful

jappyjan avatar Apr 11 '25 20:04 jappyjan