Skip to content

Commit fecbd87

Browse files
committed
test: add test to ensure additionalRequestArgs are generated when length > 0
fix: adjust api.qute to correctly handle commas when using additionalRequestArgs and dynamic url Updated the `api.qute` template to handle this safely, without affecting other parameter combinations.
1 parent 7489650 commit fecbd87

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

client/deployment/src/test/java/io/quarkiverse/openapi/generator/deployment/wrapper/OpenApiClientGeneratorWrapperTest.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -647,14 +647,11 @@ void shouldGenerateAdditionalParametersWhenLengthGreaterThanZero() throws Except
647647
CompilationUnit compilationUnit = StaticJavaParser.parse(file.orElseThrow());
648648
List<MethodDeclaration> methods = compilationUnit.findAll(MethodDeclaration.class);
649649

650-
boolean found = methods.stream().anyMatch(m ->
651-
m.getParameters().stream().anyMatch(p ->
652-
p.getNameAsString().equals("testHeader") && p.getAnnotationByName("HeaderParam").isPresent()
653-
) &&
654-
m.getParameters().stream().anyMatch(p ->
655-
p.getNameAsString().equals("id") && p.getAnnotationByName("PathParam").isPresent()
656-
)
657-
);
650+
boolean found = methods.stream()
651+
.anyMatch(m -> m.getParameters().stream().anyMatch(
652+
p -> p.getNameAsString().equals("testHeader") && p.getAnnotationByName("HeaderParam").isPresent()) &&
653+
m.getParameters().stream().anyMatch(
654+
p -> p.getNameAsString().equals("id") && p.getAnnotationByName("PathParam").isPresent()));
658655
assertTrue(found, "Additional parameters must be generated when additionalRequestArgs.length > 0");
659656
}
660657

0 commit comments

Comments
 (0)