Skip to content

Commit d617bba

Browse files
Fix Java example template to properly wrap long scenario names in comments (#3305)
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.
1 parent b5d3f79 commit d617bba

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.generator/src/generator/templates/example.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// {{ scenario.name|wordwrap(width=120)}}
1+
// {{ scenario.name|wordwrap(width=120, wrapstring='\n// ')}}
22

33
{%- 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) %}
44
{%- if context.body %}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CHANGELOG
22

3+
## 2.47.2/2025-12-11
4+
5+
### Fixed
6+
* Fix Java example template to properly wrap long scenario names in comments [#3305](https://github.com/DataDog/datadog-api-client-java/pull/3305)
7+
38
## 2.47.1/2025-12-09
49

510
### Fixed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<artifactId>datadog-api-client</artifactId>
55
<packaging>jar</packaging>
66
<name>datadog-api-client</name>
7-
<version>2.47.1</version>
7+
<version>2.47.2</version>
88
<url>https://github.com/DataDog/datadog-api-client-java</url>
99
<description>Java client library for Datadog API</description>
1010
<scm>

0 commit comments

Comments
 (0)