Skip to content

Commit

Permalink
[openapi-karate] fixes generated queryParams object
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangsa committed Nov 6, 2024
1 parent a431cef commit fc12ecf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public List<TemplateOutput> generate(Map<String, Object> contextModel) {

handlebarsEngine.getHandlebars().registerHelper("paramsExample", (params, options) -> {
return ((Collection<Map>) params).stream()
.map(p -> p.get("name") + ": " + firstNonNull(p.get("example"), jsonSchemaToJsonFaker.generateExample((Map<String, Object>) p.get("schema"))))
.map(p -> p.get("name") + ": " + firstNonNull(p.get("example"), jsonSchemaToJsonFaker.generateExample((String) p.get("name"), (Map<String, Object>) p.get("schema"))))
.collect(Collectors.joining(", "));
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{~/if}}
Given path {{{karatePath operation}}}
{{~#if (queryParams operation)}}
And def queryParams = {{{paramsExample (queryParams operation)}}}
And def queryParams = { {{{paramsExample (queryParams operation)}}} }
{{~/if}}
{{~#if operation.x--request-dto}}
And request
Expand Down

0 comments on commit fc12ecf

Please sign in to comment.