Skip to content
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

Refactor AbstractJavaCodegen and inheriting generators to allow use of modern Swagger annotations #7112

Open
InfoSec812 opened this issue Aug 2, 2020 · 12 comments

Comments

@InfoSec812
Copy link
Contributor

Description

In #2972, #6108, #5478, and many others there are complaints about old libraries/annotations being used in various Java generators. As a user of OpenAPI Generator who works in a number of Java toolkits/frameworks, I would like to see the AbstractJavaCodegen and all child generators updated to allow the use of the latest annotations and features of OpenAPI.

openapi-generator version

v5.0.0 Beta

Related issues/PRs

#2972, #6108, #5478

Suggest a fix/enhancement

I will be preparing a fork/branch which I will link in the comments below.

@InfoSec812
Copy link
Contributor Author

The work I am doing will be track in this branch:

https://github.com/InfoSec812/openapi-generator/tree/Issue_7112-_-Refactor_AbstractJavaCodegen_and_inheritors

Design Goals:

  1. MUST not break backward compatibility
  2. SHOULD allow for more flexibility in choosing supporting libraries
    • Perhaps allowing variaous x- extensions to the API Spec will be a reasonable means
  3. MUST allow for use of annotations which generate OpenAPI v3 output
  4. MUST work with inheriting generators (or update them without breaking backward compatibility)
    • Spring/SpringBoot
    • JAX-RS
    • Vert.x
    • CXF
    • Play Framework
    • MSF4J
    • Jersey
    • Java Client

@InfoSec812
Copy link
Contributor Author

InfoSec812 commented Aug 3, 2020

To start, I think that adding a non-functional (for now) option in AbstractJavaCodegen which says something like preferOpenAPIv3 and then proceeding to update each set of templates from there makes sense. Any thoughts @macjohnny?

This would allow the default to continue using the existing templates/functionality and have no impact on backward compatibility. As the community goes through and adds support to the inheriting codegen implementations we could use that option as it becomes available.

@macjohnny
Copy link
Member

@InfoSec812 Sounds good

@IncPlusPlus
Copy link
Contributor

IncPlusPlus commented Feb 5, 2021

Is #27 related to this? Also, adding a reference to #4245 here so that they're linked as well. There are a lot of different issues filed for this exact issue. I think it might be a good idea to centralize them somewhere (maybe here?).

@InfoSec812
Copy link
Contributor Author

@IncPlusPlus I would suspect that to be the case. I'm finally going to put some time into this.

@DNWEIJ
Copy link

DNWEIJ commented Feb 19, 2022

Hello, was wandering if this has got some progress

@InfoSec812
Copy link
Contributor Author

Not yet... My day job keeps getting in the way.

@ArthurEirich
Copy link

First of all, thank you, guys, for doing this great stuff. Is there any chance this feature will be added soon, @InfoSec812? Thank you once again and stay safe from Covid!

@InfoSec812
Copy link
Contributor Author

I wish I had the time. There's so much which needs work and so few hours in the day.

@ArthurEirich
Copy link

Oh how I understand... Thanks, anyway, for quick response!

@guyhmerrill
Copy link

Is there a branch where these updates are being worked on? I might be able to help some. @InfoSec812

@InfoSec812
Copy link
Contributor Author

I have made a few starts on this, but nothing worth mentioning. I just haven't had enough time to dedicate to making any significant progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants