smallrye-open-api icon indicating copy to clipboard operation
smallrye-open-api copied to clipboard

Support for (some) Springdoc annotations in the openapi spring module

Open phillip-kruger opened this issue 1 year ago • 6 comments
trafficstars

See https://github.com/quarkusio/quarkus/issues/40328

/cc @mrickly

@MikeEdgar - w.d.y.t ?

phillip-kruger avatar Apr 29 '24 06:04 phillip-kruger

This makes sense to me. Probably best to isolate it to the Spring module.

MikeEdgar avatar Apr 29 '24 16:04 MikeEdgar

@mrickly are you keen to do a PR for this ?

phillip-kruger avatar Apr 30 '24 02:04 phillip-kruger

@phillip-kruger : We are open to giving it a try. But we will need some guidance, e.g. the correct location/package for such a change. We would probably start with the ParameterObject and if it works as expected add things as the need arises.

mrickly avatar Apr 30 '24 13:04 mrickly

Ok No worries. Most of the work is done in core (https://github.com/smallrye/smallrye-open-api/tree/main/core) and core then calls out to one of jax-rs, spring or vertx. So this should be done somewhere in spring module (https://github.com/smallrye/smallrye-open-api/tree/main/extension-spring). We just need to see if the "hooks" exist in core. I would assume it will work the same way as BeanParam in jax-rs. (see https://github.com/smallrye/smallrye-open-api/blob/e47033dca7fe383ebfcc64b4c8abf64156966a3e/extension-jaxrs/src/main/java/io/smallrye/openapi/jaxrs/JaxRsParameter.java#L25). @MikeEdgar, anything to add ?

phillip-kruger avatar Apr 30 '24 23:04 phillip-kruger

This will likely be in the SpringParameterProcessor. I'm not entirely sure if @ParameterObject is analogous to @BeanParam or is it more like the MP OpenAPI @Parameter (i.e. documentation only, not functional).

MikeEdgar avatar Apr 30 '24 23:04 MikeEdgar

Hi @MikeEdgar @phillip-kruger

i posted PR https://github.com/smallrye/smallrye-open-api/pull/1823 for @mrickly .

this would solve our needs. situation is somehow "shady" as quarkus does not seem to behave exactly as spring needing @QueryParam on fields while spring does not.

thanks for your review. tell us if you need more tests whatever

flyinfish avatar May 06 '24 07:05 flyinfish