You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generated OpenAPI specs contain all three parameters in the paths: /{pathParam}: get: parameters: section.
Actual Behaviour
The generated OpenAPI specs do only contain the queryParam1 and the pathParam2. The pathParam1 is missing.
Further Observations
When queryParam1 would not use a ref, but was defined directly on the method, it would work and we could see all three parameters in the spec.
When there'd be only pathParam1 in the code, without pathParam2, then queryParam1 would be the only parameter in the generated specs.
When there's no @Parameter annotation at all, all two path parameters are generated.
When the path params are also given als @Parameter, the behaviour doesn't change compared to what's given above under "Actual Behaviour":
@Parameter(name = "pathParam1", in = ParameterIn.PATH)
@Parameter(name = "pathParam2", in = ParameterIn.PATH)
@Parameter(ref = "queryParam1")
If we would declare pathParam1 and pathParam2 through @Parameter(ref = ...), we also get similar results. However, if we leave out the queryParam1, we get pathParam2 twice -- once as ref, and once as explicit specification.
Affected Artifact
io.smallrye:smallrye-open-api-maven-plugin:2.1.1
Problem Context
I use
smallrye-open-api
to generate OpenAPI Specs from JAX-RS/MP-OpenAPI annotations. I have a method like following:While there's two
@PathParam
s, there's also a query parameter given as@Parameter
with a reference to the definition like following:Expected Behaviour
The generated OpenAPI specs contain all three parameters in the
paths: /{pathParam}: get: parameters:
section.Actual Behaviour
The generated OpenAPI specs do only contain the
queryParam1
and thepathParam2
. ThepathParam1
is missing.Further Observations
queryParam1
would not use aref
, but was defined directly on the method, it would work and we could see all three parameters in the spec.pathParam1
in the code, withoutpathParam2
, thenqueryParam1
would be the only parameter in the generated specs.@Parameter
annotation at all, all two path parameters are generated.@Parameter
, the behaviour doesn't change compared to what's given above under "Actual Behaviour":pathParam1
andpathParam2
through@Parameter(ref = ...)
, we also get similar results. However, if we leave out thequeryParam1
, we getpathParam2
twice -- once asref
, and once as explicit specification.Reproducer
mvn package
target/generated/openapi.yaml
src/main/java/ExampleResource.java
The text was updated successfully, but these errors were encountered: