We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
openapi-generator doesn't recognize default value of enum property that are $ref-ed.
current master eb4dfe0
https://gist.github.com/fujigon/4ae17fc6497cb599d1dfb53c2ebeadea#file-openapi-yaml
# 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
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
null
https://gist.github.com/fujigon/4ae17fc6497cb599d1dfb53c2ebeadea#file-inlineresponsedefault-java-L39
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.
The text was updated successfully, but these errors were encountered:
It sounds like #1981 what I have tried to address with #2001
During my tests and for @ajdergute it seems to work.
So we need to understand what additional case you need to support.
Sorry, something went wrong.
I confirmed that following up issue #2127 is fixed and now this issue is completely resolved.
Thanks for support! :)
Successfully merging a pull request may close this issue.
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
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.
The text was updated successfully, but these errors were encountered: