-
Notifications
You must be signed in to change notification settings - Fork 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
A new property additionalModelTypeAnnotations that allows to add any custom annotations on the top of generated java class model #10978
Conversation
9db5b22
to
555a9cf
Compare
555a9cf
to
6c94ea5
Compare
@HugoMario Could you please look in to this pull request. |
…custom annotations on the top of generated java class model
6c94ea5
to
7eb917a
Compare
@HugoMario Could please look in to this pull request |
@Ravisankar-Challa / @HugoMario When this change will be merged? |
@HugoMario Could you please look in to this pull request |
Hey guys, sorry for delay answer.
Yes, i'll take a look on this.
El mié., 19 may. 2021, 11:10 p. m., Ravisankar-Challa <
***@***.***> escribió:
… @HugoMario <https://github.com/HugoMario> Could you please look in to
this pull request
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10978 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAY5QMBJZYKKLFYE62EFSJ3TOSDUJANCNFSM427HN6JA>
.
|
Hey @Ravisankar-Challa sorry again for my delay response. I like the idea proposed on this PR, however there are a few things that i think it should be implemented in a different way.
I'm proposing this in order to keep the same behavior in template-generators relationship. Let me know what you think about it, also i can help with the changes i'm proposing, just add me to your PR and let me know. |
@HugoMario The idea for additionalModelTypeAnnotations is taken from open api generator. In open api code generator they are using semicolon. additionalModelTypeAnnotations let's us add any annotation on the top of generated classes. ex:- I want to add @entity annotation which comes from the package "javax.persistence" on the top of the generated classes. Then we have to provide full package name like this java -jar swagger-codegen-cli.jar generate -i swagger.yaml -l spring --additional-properties additionalModelTypeAnnotations="@javax.persistence.Entity" -o output. You are already assigned to this pull request. |
@HugoMario Please look in to this pull request |
@Ravisankar-Challa i'm on it |
LGTM thanks @Ravisankar-Challa !! |
A new property additionalModelTypeAnnotations that allows to add any custom annotations on the top of generated java class model
java -jar swagger-codegen-cli.jar generate -i swagger.yaml -l spring --additional-properties additionalModelTypeAnnotations="@com.fasterxml.jackson.annotation.JsonIgnoreProperties(ignoreUnknown = true);@com.fasterxml.jackson.annotation.JsonInclude(JsonInclude.Include.NON_NULL)",dateLibrary=java8,interfaceOnly=true,useTags=true,serializableModel=true -o ravi
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.3.0.0
branch for changes related to OpenAPI spec 3.0. Default:master
.Description of the PR
(details of the change, additional tests that have been done, reference to the issue for tracking, etc)