hey-api / openapi-ts

✨ Turn your OpenAPI specification into a beautiful TypeScript client
https://heyapi.vercel.app
Other
1.01k stars 84 forks source link

V0.53.0 generates empty core/request.ts #1019

Open ClaytonSmith opened 1 week ago

ClaytonSmith commented 1 week ago

Description

npx @hey-api/openapi-ts --input http://<URL>/openapi.json --output ./src/app/generated --client axios

0.53.0 Introduced an breaking change where the core/request.ts file is empty and none of the generated services are able to be imported due to missing dependencies.

OpenAPI specification (optional)

  1. npx @hey-api/openapi-ts --input http://<URL>/openapi.json --output ./src/app/generated --client axios
  2. Note the empty core/request.ts file
  3. Attempt to import/use any endpoint in services.gen.ts

System information (optional)

No response

stackblitz[bot] commented 1 week ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

mrlubos commented 1 week ago

Hey @ClaytonSmith, did you see the migration notes? https://heyapi.vercel.app/openapi-ts/migrating.html#renamed-legacy-clients

jpenna commented 1 week ago

I'm using the command line and fixed the issue by changing the client as mentioned in the documentation. https://heyapi.vercel.app/openapi-ts/clients/axios.html

openapi-ts -i ./openapi.json -o ./src/client --client '@hey-api/client-axios'

It changed the generated API because the default was fetch and I'm now using Axios...

mrlubos commented 1 week ago

@jpenna it sounds like your issue is resolved, is there anything you still need help with?