-
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
Swagger API requests default constructor for Jax-RS Resource #23482
Comments
Have you tried with OpenAPI rather than Swagger ? So use the annotation from MicroProfile Open API by including the smallrye-openapi extension and remove:
|
It's demo app, which I built similar to my work app. Work app is a bit complex and consists of a lot 3rd party libs. I can not introduce quarkus' specific things there, only pure CDI, swagger etc. |
It's not Quarkus specific, it's MicroProfile. But in the case you need swagger you might need to add reflection config for swagger lib classes. |
It works with
Does it mean swagger won't be fully supported in Quarkus OOB? |
We might add support for the swagger api/annotations in SmallRye OpenAPI (smallrye/smallrye-open-api#752) , but it's a duplicate, OpenAPI supports all things in Swagger. Also, you do not need to add the MicroProfile api as it will be pulled in by the quarkus openapi extension (that you already have) |
Closing. Please reopen if needed |
An example please? |
Describe the bug
Quarkus 2.7.0 Final (On 2.4.0.Final it is also reproducable)
Project for reproduce:
https://github.com/Denistr/openapi-quarkusFruits
I have constructor for JAX-RS Resource
And there is no default constructor, while I have swagger's annotation - @Api(value = "/fruits")
At starting of application, I'm getting
Expected behavior
JAX-RS resources will be initialized without default mandatory constructor
Actual behavior
2022-02-07 16:53:15,019 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: java.lang.RuntimeException: RESTEASY003190: Could not find constructor for class: org.acme.openapi.swagge
rui.FruitResource
How to Reproduce?
No response
Output of
uname -a
orver
Microsoft Windows [Version 10.0.19044.1466]
Output of
java -version
openjdk version "11" 2018-09-25 OpenJDK Runtime Environment 18.9 (build 11+28) OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.7.0. Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven home: C:\Tools\apache-maven-3.8.3 Java version: 11, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-11 Default locale: en_US, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Additional information
No response
The text was updated successfully, but these errors were encountered: