-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Description
Description
openapi-generator doesn't recognize default value of enum property that are $ref-ed.
openapi-generator version
current master eb4dfe0
OpenAPI declaration file content or url
https://gist.github.com/fujigon/4ae17fc6497cb599d1dfb53c2ebeadea#file-openapi-yaml
Command line used for generation
# git clone, etc
mvn package
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i my-api-spec/openapi.yaml -g jaxrs-jersey -o generated-code/ -v
Steps to reproduce
When I execute the generator with the gisted openapi.yaml file, I get
https://gist.github.com/fujigon/4ae17fc6497cb599d1dfb53c2ebeadea#file-inlineresponsedefault-java
The problem is that default value of enum property that are $ref-ed is null
https://gist.github.com/fujigon/4ae17fc6497cb599d1dfb53c2ebeadea#file-inlineresponsedefault-java-L39
Related issues/PRs
Suggest a fix/enhancement
I investigated and found that https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java#L703 is the problem.
current implementation of unaliasSchema method doesn't return the ref-resolved schema.
I'm working to file the PR to fix this issue.