Skip to content

Commit 6f6a754

Browse files
committed
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.
1 parent a76fb76 commit 6f6a754

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
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 %}

0 commit comments

Comments
 (0)