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 6, 2024
1 parent e184f7e commit 9649b75
Showing 1 changed file with 6 additions and 4 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

0 comments on commit 9649b75

Please sign in to comment.