swagger-codegen-generators
swagger-codegen-generators copied to clipboard
[typescript-axios] Generated interfaces contain forbidden modifier async
Description
Generated interfaces from typescript-axios
when ran with the additional property withInterfaces=true
contains the keyword async
for methods returning Promises. However, the async
modifier is not allowed in interfaces.
Compiling the resulting interfaces with tsc
results in:
error TS1070: 'async' modifier cannot appear on a type member.
Swagger-codegen version
3.0.36
Swagger declaration file content or url
https://github.com/swagger-api/swagger-codegen/blob/v3.0.36/modules/swagger-codegen/src/test/resources/3_0_0/petstore-mixed.yaml
Command line used for generation
swagger-codegen generate -i modules/swagger-codegen/src/test/resources/3_0_0/petstore-mixed.yaml -l typescript-axios -o samples/client/petstore/typescript-axios/petstore-mixed --flatten-inline-schema=true --additional-properties=withInterfaces=true
Steps to reproduce
- Install
npm
>=8.0,tsc
>=4.8 andswagger-codegen
=3.0.36 - Clone this repository and checkout tag
v3.0.36
- Run the following command
-
cd
intosamples/client/petstore/typescript-axios/petstore-mixed
- Run
npm install
- Run
tsc
Example output:
Inspecting given lines, for example, apis/user-api.ts:670:5
shows that in fact it's a member of an interface: