OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.5k stars 6.51k forks source link

[REQ][jaxrs][server] Are 8 variants of the jaxrs generator really necessary? #7120

Open ruedigerk opened 4 years ago

ruedigerk commented 4 years ago

Is your feature request related to a problem? Please describe.

Having worked on the jaxrs-spec generator for a bit in a fork and now trying to get some changes to it into the official repository, I am wondering if it is really in the best interest of the OpenAPI Generator project to support and maintain 8 different variants of jaxrs server generators with lots of code and template duplication.

Currently bug fixes and new features seem to be developed separately by the respective maintainers of the different variants, multiplying the net effort needed to maintain all the code. Also, some variants seem less well maintained, resulting in bugs not getting fixed for years (observed with the jaxrs-spec generator).

Describe the solution you'd like

Reducing the number of generators by merging them and exposing the differences via options seems desirable to me. One step in this direction is PR #6130, which I am eagerly awaiting to be merged.

Perhaps it also makes sense to additionally differentiate between the generated API classes and the model classes. The model classes depend on the used serialization libraries, whereas the API classes depend on the used JAXRS implementation. Nevertheless the generators are being distinguished by JAXRS implementation only, duplicating their model implementations, if I have seen correctly.

A third differentiator might be some kind of "server environment", distinguishing between Java Enterprise application server, Spring, Quarkus and the like.

Having had a short look at the output of the CXF and Spec variants, their differences seem mostly superficial, differing mostly in the generated Annotations and Comments (and of course differing a lot in the generated white space and formatting). Without having looked at the other generators, I hope the proposed task of unifying the generators is not impossible. ;-)

I would volunteer for working on this if the maintainers of Openapi Generator consider this a desirable goal and supporting the effort.

dhutchison commented 4 years ago

As someone who has recently put in a similar PR to the swagger codegen generators project for the same issue as #6130 I would tend to agree.

This would require effort to work out what exactly is different (both from an available settings & generation point of view). It might be my newness to this codebase, but it looks like it some cases it it should be handled by "libraries" instead of being separate implementations