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
test(jaxrs-spec/quarkus): add missing ResponseStatus annotation test coverage
Add negative tests for returnJBossResponse=true and non-Quarkus libraries to
verify @ResponseStatus is suppressed, and a positive test for interfaceOnly=false
to cover the apiMethod.mustache code path. Also fixes the response filter to
restrict to pure numeric 2xx codes only, removing 3xx support and wildcard
code guard, and drops the redundant global additionalProperties flag.
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -346,14 +346,13 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List<Mo
346
346
if (QUARKUS_LIBRARY.equals(library) && !returnResponse && !returnJbossResponse) {
347
347
for (CodegenOperationop : objs.getOperations().getOperation()) {
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java
+74-8Lines changed: 74 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1444,20 +1444,86 @@ public void generateQuarkusInterfaceDoesNotAddResponseStatusAnnotationWhenReturn
1444
1444
}
1445
1445
1446
1446
/**
1447
-
* Verify that when using the quarkus library with interfaceOnly=true and a 3xx response,
1448
-
* the generated interface method is annotated with {@code @ResponseStatus(<code>)}.
1447
+
* Verify that the {@code @ResponseStatus} annotation is NOT emitted when returnJBossResponse=true,
1448
+
* because the caller controls the status code via the {@code RestResponse} wrapper in that mode.
0 commit comments