acacode / swagger-typescript-api

Generate the API Client for Fetch or Axios from an OpenAPI Specification
MIT License
3.38k stars 361 forks source link

[BUG] [13.0.19] TypeError: e.commands is not iterable #880

Closed teyyubismayil closed 3 months ago

teyyubismayil commented 3 months ago

Folllowing command fails with TypeError: e.commands is not iterable error at version 13.0.19:

npx swagger-typescript-api --extract-request-params --axios -p ./swagger.json -n ./service.ts

0xyy commented 3 months ago

same issue here

mpoweredo commented 3 months ago

same situation in my project

0xyy commented 3 months ago

I found temporary solution for this, just run a command with specific version for example npx swagger-typescript-api@13.0.16 ...

danpoletaev commented 3 months ago

I found temporary solution for this, just run a command with specific version for example npx swagger-typescript-api@13.0.16 ...

Or you can downgrade to 13.0.16 and it works

serrg commented 3 months ago

Same issue here, confirmed that downgrading to 13.0.16 fixed it

7architect commented 3 months ago

same

pnpx swagger-typescript-api@13.0.16 -p "$TEMP_FILE" -o ./src/shared/generated -n api.ts \
    --extract-request-params \
    --extract-request-body \
    --extract-response-body \
    --extract-enums \
    --route-types \
    --axios \
    --module-name-first-tag \
    --single-http-client \
    --enum-names-as-values \
    --sort-routes \
    --sort-types
7architect commented 3 months ago

versions upper than 13.0.16 also corrupted

xavierbloemen commented 3 months ago

@smorimoto Thanks for the fix! Everything is working here again 😄

ralberts commented 3 months ago

Working for me as well with the new version! Thank you!

ahmadbakhshi commented 3 months ago

Everything is working for me too. Thank you @smorimoto

smorimoto commented 3 months ago

We've been gradually making changes to migrate the codebase to TypeScript, but in the process we've broken some things. Sorry for the bother 😑

teyyubismayil commented 3 months ago

Thanks for the fix @smorimoto!