quarkusio / quarkus

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

Support for springdoc-openapi annotations in quarkus-smallrye-openapi #40328

Open mrickly opened 2 months ago

mrickly commented 2 months ago

Description

Quarkus offers a Spring Web compatibility layer to facilitate migrations and quarkus-smallrye-openapi will generate openapi documentation for Spring controllers: https://quarkus.io/guides/openapi-swaggerui#expose-openapi-specifications Apparently springdoc-openapi annotations like @ParameterObject (https://springdoc.org/#how-can-i-extract-fields-from-parameter-object) are not supported. Annotating the parameter with the Jakarta RS @BeanParam does not work either. Are there any plans to support at least some springdoc-openapi annotations? What is the recommended migration path if not?

Implementation ideas

No response

quarkus-bot[bot] commented 2 months ago

/cc @EricWittmann (openapi), @Ladicek (smallrye), @MikeEdgar (openapi), @geoand (spring), @jmartisk (smallrye), @phillip-kruger (openapi,smallrye), @radcortez (smallrye)

phillip-kruger commented 2 months ago

Why do you say the @BeanParam does not work ? What is not working ?

mrickly commented 2 months ago

I mean simply replacing the @ParameterObject annotation with a @BeanParam annotation in a Spring @GetMapping resource will produce an openapi file that displays a body in Swagger.UI. For it to work as expected (query params in Swagger.UI), you need to replace the Spring @GetMapping resource with a Jakarta @GET resource, split off in its own class. That defeats the purpose of a compatibility layer to some extent.

phillip-kruger commented 2 months ago

A, ok, cool. I think we should be able to map ParameterObject to BeanParam. This all happens in Smallrye OpenAPI. I'll open an issue there.