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

13.0.22 is broken: [error] TypeError: Cannot read properties of undefined (reading 'split') #934

Open OnkelTem opened 2 months ago

OnkelTem commented 2 months ago

The latest version (13.0.22) seems to be broken. For any swagger-spec I tried I always receive:

ℹ start generating your typescript api
[error] TypeError: Cannot read properties of undefined (reading 'split')

Which version we can use?

OnkelTem commented 2 months ago

Trying 13.0.21: same error.

OnkelTem commented 2 months ago

More detailed trace back:

main (yarn): no error 13.0.22 (yarn): [error] TypeError: Cannot read properties of undefined (reading 'split') 13.0.21 (yarn): [error] TypeError: Cannot read properties of undefined (reading 'split') 13.0.20 (yarn): [error] TypeError: e.values(...).some is not a function 13.0.19 (yarn): [error] TypeError: e.values(...).some is not a function 13.0.18 (yarn): [error] TypeError: u.merge is not a function 13.0.17 (yarn): [error] TypeError: u.merge is not a function 13.0.16 (pnpm): no error

Code used for testing:

  async generate() {
    const { files } = await generateApi({
      output: false,
      input: this.specLocalPath,
      moduleNameFirstTag: true,
      moduleNameIndex: 1,
    })
   // ...
  }

Swagger used for testing: petstore.yaml

So the most recent working version is 13.0.16