question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`@Blocking` on resource is ignored if implementing an OpenAPI-generated interface

See original GitHub issue

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

https://github.com/quarkusio/quarkus-quickstarts/compare/main...famod:issue-15940

Steps to reproduce the behavior:

  1. git clone https://github.com/famod/quarkus-quickstarts.git
  2. git switch issue-15940
  3. cd getting-started-reactive
  4. mvn verify (no error)
  5. remove @Blocking from ReactiveGreeting.greeting()
  6. mvn verify (error regarding IO thread)

Configuration

quarkus.datasource.db-kind=h2
quarkus.datasource.username=sa
quarkus.datasource.password=sa
quarkus.datasource.jdbc.url=jdbc:h2:mem:test_quarkus;DB_CLOSE_DELAY=-1

Environment (please complete the following information):

Output of uname -a or ver

Linux XXX 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.24.0, JRE 11 Linux amd64-64-Bit Compressed References 20210120_910 (JIT enabled, AOT enabled)
OpenJ9   - 345e1b09e
OMR      - 741e94ea8
JCL      - 0a86953833 based on jdk-11.0.10+9)

(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 or gradlew --version)

Apache Maven 3.6.3

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
geoandcommented, Mar 24, 2021
0reactions
geoandcommented, Mar 26, 2021

YW!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to generate interface with openapi-generator-gradle ...
The problem I'm having is that the plugin in generating classes instead of interfaces. A generated class looks like this: public class ...
Read more >
Using OpenAPI and Swagger UI - Quarkus
In this guide, we create a straightforward REST application to demonstrate how fast you can expose your API specification and benefit from a...
Read more >
Documentation for the java Generator
#CONFIG OPTIONS ; hideGenerationTimestamp, Hides the generation timestamp when files are generated. ; ignoreAnyOfInEnum, Ignore anyOf keyword in ...
Read more >
OpenAPI 3 Library for spring-boot
This dependency is relevant if you want to generate the OpenAPI description without using the swagger-ui. For custom path of the OpenAPI ......
Read more >
aws_api_gateway_rest_api | Resources | hashicorp/aws
To create and deploy WebSocket and HTTP APIs, use Amazon API Gateway Version 2 resources. WARN: When importing Open API Specifications with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found