From 77fecf27eb68500d62df3d056ce98d999af13839 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 9 Jan 2026 18:10:43 +0000 Subject: [PATCH 1/5] bin/generate-samples: Remove warning about sleep The sleep itself has been commented out for a long time (commit 04fa53b69266 from September 2023, to be specific). Signed-off-by: Stephen Finucane --- bin/generate-samples.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/bin/generate-samples.sh b/bin/generate-samples.sh index 197eb9183912..f1d3303024ac 100755 --- a/bin/generate-samples.sh +++ b/bin/generate-samples.sh @@ -52,8 +52,6 @@ if [[ ${#files[@]} -eq 1 && "${files[0]}" != *'*'* ]]; then # shellcheck disable=SC2068 java ${JAVA_OPTS} -jar "$executable" generate -c ${files[0]} ${args[@]} else - echo "Please press CTRL+C to stop or the script will continue in 5 seconds." - #sleep 5 if [ ${#files[@]} -eq 0 ]; then files=("${root}"/bin/configs/*.yaml) fi From 588b3a9ce0e5ccf8d0fe42b672ad3a138b7b1ab4 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 20 Jan 2026 13:36:36 +0000 Subject: [PATCH 2/5] bin/generate-samples: Fix output on tmux Commit 23dae2bcd8c9 reworked this script to start capturing exceptions but the mechanism used was crude and broke output on tmux, since `/dev/pts/0` is hardcoded to a specific pseudo-terminal but each tmux pane gets its own pts. Rework this to use files instead. Signed-off-by: Stephen Finucane --- bin/generate-samples.sh | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/bin/generate-samples.sh b/bin/generate-samples.sh index f1d3303024ac..b282b313c5c2 100755 --- a/bin/generate-samples.sh +++ b/bin/generate-samples.sh @@ -47,24 +47,26 @@ For example: echo "$header" +tmpfile=$(mktemp) +trap "rm -f $tmpfile" EXIT + if [[ ${#files[@]} -eq 1 && "${files[0]}" != *'*'* ]]; then - # shellcheck disable=SC2086 - # shellcheck disable=SC2068 - java ${JAVA_OPTS} -jar "$executable" generate -c ${files[0]} ${args[@]} + # shellcheck disable=SC2086 + # shellcheck disable=SC2068 + java ${JAVA_OPTS} -jar "$executable" generate -c ${files[0]} ${args[@]} 2>&1 | tee "$tmpfile" + retcode=${PIPESTATUS[0]} else - if [ ${#files[@]} -eq 0 ]; then - files=("${root}"/bin/configs/*.yaml) - fi + if [ ${#files[@]} -eq 0 ]; then + files=("${root}"/bin/configs/*.yaml) + fi - # shellcheck disable=SC2086 - # shellcheck disable=SC2068 - if java ${JAVA_OPTS} -jar "$executable" batch ${BATCH_OPTS} --includes-base-dir "${root}" --fail-fast -- ${files[@]} 2>&1 | tee /dev/pts/0 | grep -q -i "exception"; then - echo "Found exception(s) when running the generator(s) to update the samples." - export GENERATE_ERROR=1 - fi + # shellcheck disable=SC2086 + # shellcheck disable=SC2068 + java ${JAVA_OPTS} -jar "$executable" batch ${BATCH_OPTS} --includes-base-dir "${root}" --fail-fast -- ${files[@]} 2>&1 | tee "$tmpfile" + retcode=${PIPESTATUS[0]} fi -if [[ -n "$GENERATE_ERROR" ]]; then +if [[ $retcode -ne 0 ]] || grep -q -i "exception" "$tmpfile"; then echo "Found exception(s) when running the generator(s) to update the samples." exit 1 fi From 34aee1c2cb3f6e94c58ff8876e05769f65f0b029 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 22 Jan 2026 16:39:45 +0800 Subject: [PATCH 3/5] update error message --- bin/generate-samples.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/generate-samples.sh b/bin/generate-samples.sh index b282b313c5c2..f2bcd570cb68 100755 --- a/bin/generate-samples.sh +++ b/bin/generate-samples.sh @@ -66,7 +66,7 @@ else retcode=${PIPESTATUS[0]} fi -if [[ $retcode -ne 0 ]] || grep -q -i "exception" "$tmpfile"; then +if [[ $retcode -ne 0 ]] || grep -q -i "at org.openapitools" "$tmpfile"; then echo "Found exception(s) when running the generator(s) to update the samples." exit 1 fi From 88dce90e041c2071682645bdc047464cdfa90ed0 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 22 Jan 2026 16:54:08 +0800 Subject: [PATCH 4/5] trigger build failure --- .../main/java/org/openapitools/codegen/OpenAPINormalizer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java index c91802e8e7fb..0bac66dd18dc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java @@ -722,7 +722,7 @@ protected boolean isSelfReference(String name, Schema subSchema) { */ public Schema normalizeSchema(Schema schema, Set visitedSchemas) { // normalize reference schema - if (schema != null && StringUtils.isNotEmpty(schema.get$ref())) { + if (StringUtils.isNotEmpty(schema.get$ref())) { normalizeReferenceSchema(schema); } From fc46b0556a20380ed89e7f1f6e7e338236683f4c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 22 Jan 2026 17:05:57 +0800 Subject: [PATCH 5/5] Revert "trigger build failure" This reverts commit 88dce90e041c2071682645bdc047464cdfa90ed0. --- .../main/java/org/openapitools/codegen/OpenAPINormalizer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java index 0bac66dd18dc..c91802e8e7fb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java @@ -722,7 +722,7 @@ protected boolean isSelfReference(String name, Schema subSchema) { */ public Schema normalizeSchema(Schema schema, Set visitedSchemas) { // normalize reference schema - if (StringUtils.isNotEmpty(schema.get$ref())) { + if (schema != null && StringUtils.isNotEmpty(schema.get$ref())) { normalizeReferenceSchema(schema); }