From 943bd762d62553b7b3fa3cb6bdf2bd687080bd50 Mon Sep 17 00:00:00 2001 From: Julien Doche Date: Wed, 10 Dec 2025 14:28:25 +0100 Subject: [PATCH] Fix Java example template to properly wrap long scenario names in comments When scenario names exceed 120 characters, the wordwrap filter was creating a new line without the comment prefix '//'. This caused Java compilation errors like 'class, interface, enum, or record expected'. The fix adds the wrapstring parameter to preserve the comment prefix on wrapped lines. --- .generator/src/generator/templates/example.j2 | 2 +- CHANGELOG.md | 5 +++++ pom.xml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.generator/src/generator/templates/example.j2 b/.generator/src/generator/templates/example.j2 index ebb5f71f92f..60d4e9aa825 100644 --- a/.generator/src/generator/templates/example.j2 +++ b/.generator/src/generator/templates/example.j2 @@ -1,4 +1,4 @@ -// {{ scenario.name|wordwrap(width=120)}} +// {{ scenario.name|wordwrap(width=120, wrapstring='\n// ')}} {%- set required_parameters, optional_parameters, parameters_models = format_parameters(context.api_request.kwargs, spec=operation_spec, replace_values=context._replace_values, has_body=context.body) %} {%- if context.body %} diff --git a/CHANGELOG.md b/CHANGELOG.md index d3150b56fb1..f79c1443c9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # CHANGELOG +## 2.47.2/2025-12-11 + +### Fixed +* Fix Java example template to properly wrap long scenario names in comments [#3305](https://github.com/DataDog/datadog-api-client-java/pull/3305) + ## 2.47.1/2025-12-09 ### Fixed diff --git a/pom.xml b/pom.xml index cde756378be..9ca88b4636c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ datadog-api-client jar datadog-api-client - 2.47.1 + 2.47.2 https://github.com/DataDog/datadog-api-client-java Java client library for Datadog API