-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
@Blocking
on resource is ignored if implementing an OpenAPI-generated interface
#15940
Comments
I think this is more something for you @cescoffier or @geoand or @FroMage. |
We could certainly also consult the implementation class (it makes perfect sense to do so), however this seems to be a general issue - we only seem to consult the annotation from the interface. @FroMage do you remember if the spec mentions something specific about annotations on the interface vs the impl class? |
https://quarkus.io/specs/jaxrs/2.1/index.html#annotationinheritance says:
So we should look at whatever source has any JAX-RS annotation. Also note that superclass is favoured over superinterfaces. |
Very interesting, thanks! |
Which wouldn't solve my problem, would it? I do understand the spec part, but |
It isn't true, but I am not entirely convinced we should differentiate the standard behavior here. |
Right now, this issue is not a big deal for my current project. We just add it to a mustache template we have to override anyway and everything is blocking (which suites our current needs). But as soon as we want to have certain calls non-blocking, things will become verbose: |
I see your point.
I'll think about it a bit more
…On Wed, Mar 24, 2021, 00:19 Falko Modler ***@***.***> wrote:
Right now, this issue is not a big deal for my current project. We just
add it to a mustache template we have to override anyway and everything is
blocking (which suites our current needs).
But as soon as we want to have certain calls non-blocking, things will be
come verbose:
We would either need to introduce a vendor extension to control when to
generate @Blocking, which pollutes the OpenAPI file with internals.
Or we would need to use that Infrastructure-something class (don't have
the code in front of me right now) to make all respective Mutiny calls
blocking.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15940 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBMDP7UJTFGBTRF3K6RMWTTFEHWTANCNFSM4ZUCDGBQ>
.
|
…JAX-RS Resources Fixes: quarkusio#15940
#15987 should take care of it |
Allow using @Blocking on implementation in addition to interface for JAX-RS Resources
@geoand Thanks a lot for this rapid turnaround! |
YW! |
…JAX-RS Resources Fixes: quarkusio#15940 (cherry picked from commit 7144efb)
…JAX-RS Resources Fixes: quarkusio#15940
Describe the bug
When generating interfaces from a OpenAPI defintion file via https://github.com/OpenAPITools/openapi-generator, all Jax-RS annotations are added to the interface so you don't have to repeat them in your actual resource that implements the interface.
If you decide that you need
@Blocking
, you have to put it in the interface to have it recognized.Expected behavior
Since blocking or not is an implementation detail, I should not be forced to put this in the (generated) resource interface.
Actual behavior
As soon as a resource implements an interface that contains alls the Jax-RS annotations,
@Blocking
on the actually implemented methods (or the resource class) is ignored.To Reproduce
quarkusio/quarkus-quickstarts@main...famod:issue-15940
Steps to reproduce the behavior:
@Blocking
fromReactiveGreeting.greeting()
Configuration
Environment (please complete the following information):
Output of
uname -a
orver
Output of
java -version
(also happens with HotSpot)
GraalVM version (if different from Java)
Quarkus version or git rev
1.12.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.6.3
Additional context
The text was updated successfully, but these errors were encountered: