Using quarkus-smallrye-openapi, OpenApiHandler.getOpenApiDocumentService is null when quarkus.arc.strict-compatibility=true #39779
Labels
area/arc
Issue related to ARC (dependency injection)
area/openapi
area/smallrye
kind/bug
Something isn't working
Milestone
Describe the bug
When using the quarkus-smallrye-openapi to generate OpenAPI specs and Swagger UI for a REST service, including
quarkus.arc.strict-compatibility=true
in application.properties causes the/q/openapi
endpoint to fail.Attempting to request via a browser shows one of two stacktraces:
One possible exception (a NullPointerException)
Another possible exception
Expected behavior
Expect
/q/openapi
endpoint to return an OpenAPI spec whether quarkus.arc.strict-compatibility is true or false.Actual behavior
/q/openapi
return an OpenAPI spec when quarkus.arc.strict-compatibility is unspecified, and returns an error when that property is set to true.How to Reproduce?
https://github.com/quarkusio/quarkus-quickstarts.git
openapi-swaggerui-quickstart
To see good behavior:
mvn quarkus:dev
curl http://localhost:8080/q/openapi
and see good OpenAPI specq
to quit dev modeTo see bad behavior:
echo quarkus.arc.strict-compatibility=true >> src/main/resources/application.properties
mvn clean quarkus:dev
curl http://localhost:8080/q/openapi
and see errorOutput of
uname -a
orver
Darwin my-dev-machine 22.6.0 Darwin Kernel Version 22.6.0: Tue Nov 7 21:42:24 PST 2023; root:xnu-8796.141.3.702.9~2/RELEASE_ARM64_T6020 arm64
Output of
java -version
java version "17.0.6" 2023-01-17 LTS Java(TM) SE Runtime Environment (build 17.0.6+9-LTS-190) Java HotSpot(TM) 64-Bit Server VM (build 17.0.6+9-LTS-190, mixed mode, sharing)
Quarkus version or git rev
3.8.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)% mvn -version Apache Maven 3.9.4 (dfbb324ad4a7c8fb0bf182e6d91b0ae20e3d2dd9) Maven home: $HOME/opt/apache-maven-3.9.4 Java version: 17.0.6, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "13.6.3", arch: "aarch64", family: "mac"
Additional information
No response
The text was updated successfully, but these errors were encountered: