From b300df1c5ddc0ae1d8bfb5f61a5660352334b3c4 Mon Sep 17 00:00:00 2001 From: Olivier Lando Date: Wed, 6 Nov 2024 09:48:06 +0100 Subject: [PATCH] Fix java generator --- .../src/main/java/video/api/client/generator/Java.java | 10 ++++++---- templates/php/README.mustache | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apivideo-generator/src/main/java/video/api/client/generator/Java.java b/apivideo-generator/src/main/java/video/api/client/generator/Java.java index e68412f6..915776e6 100644 --- a/apivideo-generator/src/main/java/video/api/client/generator/Java.java +++ b/apivideo-generator/src/main/java/video/api/client/generator/Java.java @@ -75,10 +75,12 @@ public Map postProcessOperationsWithModels(Map o .flatMap(p -> p.vars.stream()) .forEach(v -> { if (v.dataType.equals("List")) { - 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) { diff --git a/templates/php/README.mustache b/templates/php/README.mustache index cc1068e7..0df524e1 100644 --- a/templates/php/README.mustache +++ b/templates/php/README.mustache @@ -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 ⭐