Skip to content

Commit

Permalink
Fix java generator
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier-lando committed Nov 8, 2024
1 parent e184f7e commit b300df1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> o
.flatMap(p -> p.vars.stream())
.forEach(v -> {
if (v.dataType.equals("List<String>")) {
v.example = "Arrays.asList(" + v.example
.replaceAll("\\[", "")
.replaceAll("\\]", "")
.replaceAll("\\\\\"", "\"") + ")";
if(v.example != null) {
v.example = "Arrays.asList(" + v.example
.replaceAll("\\[", "")
.replaceAll("\\]", "")
.replaceAll("\\\\\"", "\"") + ")";
}
} else if (v.isArray) {
v.example = "Collections.<" + v.items.dataType + ">emptyList()";
} else if (v.isString) {
Expand Down
2 changes: 1 addition & 1 deletion templates/php/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ $ BASE_URI="" API_KEY="..." vendor/bin/phpunit
```


## Have you gotten use from this API client?
## Have you gotten use from this API client?

Please take a moment to leave a star on the client ⭐

Expand Down

0 comments on commit b300df1

Please sign in to comment.