quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.53k stars 2.61k forks source link

Server-side JAX-RS generation based on OpenAPI definition #18683

Closed carlesarnal closed 1 year ago

carlesarnal commented 3 years ago

Description

I am proposing a new extension that will perform a generation of the server-side code from an OpenAPI specification.

This extension can be based on the already existing Apicurio Studio codegen feature. This code allows users to generate server-side (essentially JAX-RS classes and POJOs). This will also allow Quarkus to not be dependent on swagger-codegen nor openapi-generator

This new extension will address https://github.com/quarkusio/quarkus/issues/3905.

Interested in this extension, please +1 via the emoji/reaction feature of GitHub (top right).

Configuration suggestion

No response

Additional context

No response

quarkus-bot[bot] commented 3 years ago

/cc @EricWittmann, @MikeEdgar, @phillip-kruger

gsmet commented 2 years ago

An extension is in progress in the Quarkiverse now: https://github.com/quarkiverse/quarkus-openapi-generator .

carlesarnal commented 2 years ago

@gsmet Actually, the extension I was proposing was to generate the server-side part, not the client. I think the one you're pointing can be used to generate rest clients, no?

gsmet commented 2 years ago

Ah you're right, I missed this extension was only about clients. The name is not ideal then :/

geoand commented 1 year ago

@carlesarnal what is the plan for this? AFAIU, your team has something ready to go, correct?

carlesarnal commented 1 year ago

Yes! We have an extension ready to be contributed.

geoand commented 1 year ago

That's great! It would to the advantage of the community if this extension were present in the Quarkiverse (cc @gastaldi)

carlesarnal commented 1 year ago

Of course, just let me know where to start/where to contribute and I would be more than happy to do it.

geoand commented 1 year ago

https://github.com/quarkiverse/quarkiverse/wiki is the place to get started. If you have any issues, @gastaldi is the Quarkiverse overlord :)

gastaldi commented 1 year ago

I wonder if the beforementioned repository couldn't also host this extension (as a multimodule project). What do you think @ricardozanini @hbelmiro ?

ricardozanini commented 1 year ago

That might be a good idea but would require some work in the docs and CI. A part from that, we are planning to remove the openapi-generator dependency and use Apicurio, so that could be in handy.

gastaldi commented 1 year ago

AFAIK CI would remain the same and docs would remain in the same path (since it's processed by Antora). What kind of work are you referring to specifically?

ricardozanini commented 1 year ago

More of ina structure level :)

For the CI we will need to change the job to also run the other module, for docs the structure. Which can come in handy to just migrate to Antora. Small things, but we should do them anyway.

gastaldi commented 1 year ago

So my idea is to have it structured from this:

pom.xml
├── deployment
└── runtime

to this:

pom.xml
├── client
│   ├── deployment
│   └── runtime
└── server
    ├── deployment
    └── runtime

Because the root pom.xml has <module>client</module> and <module>server<module> no CI scripts would need to be changed.

As for docs, just keep it in the root, like how it was done in https://github.com/quarkiverse/quarkus-pact

ricardozanini commented 1 year ago

That makes sense 👍

gastaldi commented 1 year ago

@carlesarnal do you see any drawbacks to the proposed structure in https://github.com/quarkiverse/quarkus-openapi-generator? Mind submitting a PR including it?

carlesarnal commented 1 year ago

No drawbacks, I will contribute the extension there with the structure proposed.

gastaldi commented 1 year ago

@carlesarnal fantastic! I created https://github.com/quarkiverse/quarkiverse-devops/pull/116 (waiting for approval from the repository maintainers) giving you maintainer access on that repository too ;)

I'll close this issue for now. Thank you!