[typescript-angular] not generating enums as enum type
Description
I have an enum in my swagger scheme, but after generating the typescript-angular client with swagger codegen, the generated 'enum' looks like below:

The generator should use the typescript enum type instead of creating a custom object.
Swagger-codegen version
2.4.17
Swagger declaration file content or url
Command line used for generation
java -jar swagger-codegen-cli.jar generate -i http://localhost:54371/swagger/v1/swagger.json -l typescript-angular -o .
Steps to reproduce
Generate angular-typescript client with the swagger declaration file
Related issues/PRs
/
Suggest a fix/enhancement
/
I have the same issue, tweaking the swagger config, I managed to get semantic strings generated but still no actual enums. Any ideas from the Swagger guys on this?
I have the same issue
Any updates or workarounds to fix this?
EDIT: I can get it to work if i use the config option: "stringEnums": true and add the enum names under x-enum-varnames in the swagger.json
Any updates or workarounds to fix this?
EDIT: I can get it to work if i use the config option: "stringEnums": true and add the enum names under x-enum-varnames in the swagger.json
I can't confirm EDIT part. I have x-enum-varnames block in my spec and stringEnums option in command (see below). Neither for my version of generator, not for the latest it does not work. Same for axios vs angular language. Ended with a template-based workaround
java \
--add-opens=java.base/java.util=ALL-UNNAMED \
-Dmodels \
-Dapis \
-DsupportingFiles \
-Dfile.encoding=UTF-8 \
-DstringEnums=true \
-jar ./swagger-codegen-cli-3.0.34.jar \
generate \
-i ./.etc/swagger-spec.json \
-o ./.etc/sdk \
-l typescript-axios