Describe the bug
@Parameter with in = ParameterIn.Query are left out of the openapi.json, only the last @Parameter is actually show in openapi.json (and if it was explicitly defined in the signature as a @QueryParam
Expected behavior
All the parameters are listed in the openapi.json
Actual behavior
Only last @Parameter is shown and the ones that are set as @QueryParam in the method
To Reproduce
Steps to reproduce the behavior:
@Operation(summary = "foo")
@GET
@Path("/foo")
@Parameter(
name="foo1",
in = ParameterIn.QUERY,
description = "Im foo 1"
)
@Parameter(
name="foo2",
in = ParameterIn.QUERY,
description = "Im foo 2"
)
@Parameter(
name="bar1",
in = ParameterIn.QUERY,
description = "Im bar 1"
)
@Parameter(
name="bar2",
in = ParameterIn.QUERY,
description = "Im bar 2"
)
public Response foo(@QueryParam String foo1) {
return Response.ok().build();
}
Environment (please complete the following information):
uname -a or ver:Output of java -version:
openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment 18.9 (build 11.0.5+10)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.5+10, mixed mode, sharing)
GraalVM version (if different from Java):
Quarkus version or git rev:
1.4.2
Build tool (ie. output of mvnw --version or gradlew --version):
Maven home: /home/josejulio/.m2/wrapper/dists/apache-maven-3.6.3-bin/1iopthnavndlasol9gbrbg6bf2/apache-maven-3.6.3
Java version: 11.0.5, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-11-openjdk-11.0.5.10-0.fc29.x86_64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.0.6-200.fc29.x86_64", arch: "amd64", family: "unix"
Additional context
Also tried with @Parameters annotation and the same effect
/cc @EricWittmann
/cc @phillip-kruger @MikeEdgar
@MikeEdgar @kenfinnigan
Changes that might cause this:
https://github.com/smallrye/smallrye-open-api/compare/1.2.1...1.2.3
Any idea ?
@phillip-kruger , definitely one of the two from Apr 6 or Apr 8, assuming this worked in an earlier version.
@phillip-kruger , the intent of that method is to match JAX-RS and OpenAPI annotations. If there is no match the method calling it is supposed to treat it as standalone.
@josejulio - are you using inheritance or interfaces with your JAX-RS resource class?
@josejulio - are you using inheritance or interfaces with your JAX-RS resource class?
No, this is the class that is showing the error: https://github.com/RedHatInsights/policies-ui-backend/blob/master/src/main/java/com/redhat/cloud/policies/app/rest/PolicyCrudService.java#L90
The reproducer triggers the error there.
This is definitely due to smallrye/smallrye-open-api#293. I'm thinking about how to rework that change.
This should be fixed once we pull in the next version of SmallRye. Thanks @MikeEdgar !
Could this PLEASE end up in Quarkus 1.4.3 or 1.5.1 ?
Hi @pilhuhn - I'll get a patch out for 1.5.1
Most helpful comment
Hi @pilhuhn - I'll get a patch out for 1.5.1