-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
OAS 3.0 - Use OAS 3.0 annotations instead of old Swagger 1.5.x / OAS 2.x ones (@Api / @ApiXxx) #90
Comments
It totally makes sense to me. |
@reta Hi! Yup, that makes perfect sense. Of course it would mean using all 2.x annotations and not just |
Thank you guys, on it. |
@webron @HugoMario I started the work on this issue, the scope is larger then I initially expected, I opened #101 (work-in-progress) so you guys could see the progress and guide me through. As I have got to know the code a bit more, my understanding is that |
Hello @reta , sorry for delay answer, i wasn't around these last days. I think your approach is correct and PR LGTM, but i think we need to add an option that let users keep on using the previous annotation. I can help with that. So the idea is having by default the OAS 3 annotation but leaving an option to anybody that want to keep using the previous one. Let me know if you are done with changes here and i'll file a new ticket for that. Thanks! |
Hey @HugoMario, Thanks for looking! Yeah, it would be a bit of work / conditionals, but makes sense overall, will be working on updating the PR to have both specs supported. Thanks! |
Hey @reta |
this has been implemented, so let's close it |
As of now, Swagger Codegen always uses old (
1.5.x
) Swagger annotations,@ApiModel
/@ApiModelProperty
to decorate model classes, even if the input specification comes in OAS 3.0.x format. I believe it would make sense to use the Swagger 2.0.x@Schema
annotations in this case since it corresponds to OAS 3.0.x specification and has different, richer set of attributes.It could be done either on advisory level, for example using
configOptions
(in case ofswagger-codegen-maven-plugin
):Or, if feasible, could be done automatically in case Swagger Codegen recognizes that specification corresponds to OAS 3.0.x. Here is the example of the model class:
@webron would appreciate your opinion, if the issue makes sense, I will submit the PR for it.
Thank you!
The text was updated successfully, but these errors were encountered: