Skip to content

[C#][generichost] Fix enum generation#24069

Open
Killianven wants to merge 1 commit into
OpenAPITools:masterfrom
Killianven:patch-2
Open

[C#][generichost] Fix enum generation#24069
Killianven wants to merge 1 commit into
OpenAPITools:masterfrom
Killianven:patch-2

Conversation

@Killianven

@Killianven Killianven commented Jun 19, 2026

Copy link
Copy Markdown

Using the template genericHost to generate c# client api,
Previous version cause the enum variable wrote with a jump in the JsonConverter.mustach, So the project won't compile

ex :
myEnum
RawValue

The solution write it well
myEnumRawValue


Summary by cubic

Fix enum name generation in the C# generichost template by removing an unintended line break in JsonConverter.mustache. Names like myEnumRawValue are now emitted on one line instead of being split (myEnum + newline + RawValue), so generated projects compile.

Written for commit adc181b. Summary will update on new commits.

Review in cubic

Previous version cause the enum variable wrote with a jump.
So the project won't compile

ex : 
myEnum
RawValue

The solution write it well
myEnumRawValue

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

@vgilabert vgilabert left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had the same issue, this fixed the problem

@wing328 wing328 changed the title Fix enum generation [C#][generichost] Fix enum generation Jun 21, 2026
@wing328

wing328 commented Jun 21, 2026

Copy link
Copy Markdown
Member

thanks for the PR

please follow step 3 in the PR checklist to update the samples so as to fix https://github.com/OpenAPITools/openapi-generator/actions/runs/27835579713/job/82583767366?pr=24069

cc @devhl-labs

{{#lambda.copyText}}
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}
{{/lambda.copyText}}
{{#lambda.copyText}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/lambda.copyText}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stacking these on one line will introduce unintended whitespace. There is already a trim lambda. You can add it to the abstract C# class and use it here.

{{/lambda.trimTrailingWithNewLine}}
}
} No newline at end of file
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please try not to make unintended whitespace changes like this added line break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants