Closed Denistr closed 2 years ago
/cc @MikeEdgar, @phillip-kruger
Have you tried with OpenAPI rather than Swagger ? So use the annotation from MicroProfile Open API by including the smallrye-openapi extension and remove:
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.16</version>
</dependency>
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
<dependency>
<groupId>org.eclipse.microprofile.openapi</groupId>
<artifactId>microprofile-openapi-api</artifactId>
<version>3.0</version>
</dependency>
Does it mean swagger won't be fully supported in Quarkus OOB?
We might add support for the swagger api/annotations in SmallRye OpenAPI (https://github.com/smallrye/smallrye-open-api/issues/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
config
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