-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG][Go] Inline enums not generated #2360
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
Hi, is there any updates on this issue? |
The issue is still relevant btw. Only fix I've been able to find is to reference enum type:
Inline definitions, such as:
unfortunately won't work. |
#16582 includes an example for generating inline enums using custom templates, which may be useful for teams using For users of |
Bug Report Checklist
Description
Enums that are declared inline are simply being declared as strings, while the same enum defined as a separate schema is properly captured with all legal values.
openapi-generator version
4.0.0-SNAPSHOT
built from this commit: b128d14OpenAPI declaration file content or url
sample.yaml:
Command line used for generation
java -jar openapi-generator-cli.jar generate -i sample.yaml -g go -o ./sample-go
Steps to reproduce
git clone https://github.com/OpenAPITools/openapi-generator.git
cd openapi-generator
git checkout b128d1470709c44c6c7b6a906e1993d1c2758b52
mvn clean install
ln -s modules/openapi-generator-cli/target/openapi-generator-cli.jar .
java -jar openapi-generator-cli.jar generate -i sample.yaml -g go -o ./sample-go
Related issues/PRs
#2200
#1702
#1706
Actual vs Expected output
Go:
model_status_details.go (actual):
model_status_details.go (expected):
Suggest a fix
PR has been put up: #2494
The text was updated successfully, but these errors were encountered: