Open mroland91 opened 5 years ago
👍 Thanks for opening this issue! 🏷 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
You can use --additional-properties=enumClassPrefix=true That will serve the purpose.
Description
When I generate Go model code for an enum where a value starts with a number then the generated const will be unexported.
Actual: // List of AccessType const ( _3_GPP_ACCESS AccessType = "3GPP_ACCESS" NON_3_GPP_ACCESS AccessType = "NON_3GPP_ACCESS" )
Expected e.g.: // List of AccessType const ( ACCESS_TYPE_3_GPP_ACCESS AccessType = "3GPP_ACCESS" ACCESS_TYPE_NON_3_GPP_ACCESS AccessType = "NON_3GPP_ACCESS" )
Input validation:
docker run --rm -it -w /gen -e GEN_DIR=/gen -e MAVEN_CONFIG=/var/maven/.m2 -u 0:0 -v /ephemeral/opentas/openapi-generator:/gen -v /root/.m2:/root/.m2 --entrypoint /gen/docker-entrypoint.sh maven:3-jdk-8 validate -i 5GC_APIs/TS29122_CommonData.yaml Validating spec (5GC_APIs/TS29122_CommonData.yaml) No validation issues detected.
docker run --rm -it -w /gen -e GEN_DIR=/gen -e MAVEN_CONFIG=/var/maven/.m2 -u 0:0 -v /ephemeral/opentas/openapi-generator:/gen -v /root/.m2:/root/.m2 --entrypoint /gen/docker-entrypoint.sh maven:3-jdk-8 validate -i 5GC_APIs/TS29518_Namf_MT.yaml Validating spec (5GC_APIs/TS29518_Namf_MT.yaml) No validation issues detected.
openapi-generator version
4.0.0-SNAPSHOT
OpenAPI declaration file content or url
Type: https://github.com/jdegre/5GC_APIs/blob/7298845c7ede07038838d5c40debb083f929f98b/TS29571_CommonData.yaml#L537
Service: https://github.com/jdegre/5GC_APIs/blob/78b04e48a7fb92b1a5dc6f95419c9ed2f6c3c5ed/TS29518_Namf_MT.yaml#L164
Command line used for generation
./run-in-docker.sh generate -i 5GC_APIs/TS29518_Namf_MT.yam -g go -o /gen/out -Dmodels
Steps to reproduce
./run-in-docker.sh generate -i 5GC_APIs/TS29518_Namf_MT.yam -g go -o /gen/out -Dmodels cat out/model_access_type.go