Manweill / swagger-axios-codegen

swagger client to use axios and typescript
MIT License
306 stars 83 forks source link

Bug: All enum keys interpreted as Number #115

Closed SinBirb closed 4 years ago

SinBirb commented 4 years ago

Hi,

there is an error in the last PR (https://github.com/Manweill/swagger-axios-codegen/pull/65) which results in all enum keys being interpreted as type Number and getting prefixed with KEY_. That's likely because the code uses Number.isNaN instead of isNaN.

Affected lines: https://github.com/Manweill/swagger-axios-codegen/blob/7220bb08016c386167c5cdd5ab07bc3f976c5f0a/src/componentsCodegen/createDefinitionEnum.ts#L12 https://github.com/Manweill/swagger-axios-codegen/blob/7220bb08016c386167c5cdd5ab07bc3f976c5f0a/src/definitionCodegen/createDefinitionEnum.ts#L12

See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN

fairking commented 4 years ago

PR has been created: https://github.com/Manweill/swagger-axios-codegen/pull/120

Also related issue (duplicate): #119