openapistack / openapi-client-axios

JavaScript client library for consuming OpenAPI-enabled APIs with axios
https://openapistack.co
MIT License
550 stars 67 forks source link

TypeError: Cannot read properties of undefined (reading 'replace') for DHL open api #135

Closed JannikZed closed 1 year ago

JannikZed commented 1 year ago

I was just trying out the typegen of your project, using the DHL open api specs: pnpm typegen https://developer.dhl.com/sites/default/files/2022-08/dpdhl_tracking-unified_1.3.2_0.yaml resulting in a type error:

pnpm typegen https://developer.dhl.com/sites/default/files/2022-08/dpdhl_tracking-unified_1.3.2_0.yaml 
/Users/jannik/Documents/git/eci/node_modules/.pnpm/openapi-client-axios-typegen@5.3.1_js-yaml@4.1.0/node_modules/openapi-client-axios-typegen/typegen.js:80
    key = key.replace(/\/(.)/g, function (_match, p1) {
              ^

TypeError: Cannot read properties of undefined (reading 'replace')
anttiviljami commented 1 year ago

Hi @JannikZed, looks like the DHL openapi is missing operationId for its operations, so typegen can't generate operation methods.