Skip to content

[csharp][generichost] fix date serialization indentation - #25804

Merged
wing328 merged 3 commits into
OpenAPITools:masterfrom
daberni:codex/fix-csharp-date-indentation
Nov 24, 2026
Merged

wing328 merged 3 commits into
OpenAPITools:masterfrom
daberni:codex/fix-csharp-date-indentation

Conversation

@daberni

@daberni daberni commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Align the braces and both serialization statements for default date and date-time fields in C# Generic Host model converters. The shared partial preserves required, optional, and nullable field handling. Explicit format extensions retain the existing writer.

The regenerated samples differ only in whitespace.

Verification

  • Built the generator CLI from the upstream master base with ./mvnw -B -pl modules/openapi-generator-cli -am package -DskipTests.
  • Regenerated all 51 Generic Host sample configurations using bin/generate-samples.sh and verified the sample diff with git diff -w.
  • Ran the .NET 8 Petstore model tests. All 385 passed.

cc @mandrean @shibayan @Blackclaws @lucamazzanti


Summary by cubic

Fixes misaligned braces and inconsistent indentation in C# Generic Host JSON model converters for date and date-time field serialization. The guarded property writing logic is now extracted into a shared WriteGuardedPropertyValue.mustache partial, so required, optional, and nullable fields produce correctly aligned output.

The regenerated samples differ only in whitespace, and all 385 .NET 8 Petstore model tests pass.

Written for commit 2a1d17a. Summary will update on new commits.

View guided diff

@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.

All reported issues were addressed across 115 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

@daberni daberni changed the title Fix C# Generic Host date serialization indentation [csharp][generichost] fix date serialization indentation Nov 23, 2026
@wing328

wing328 commented Nov 24, 2026

Copy link
Copy Markdown
Member

thanks for the PR

cc @devhl-labs

@wing328

wing328 commented Nov 24, 2026

Copy link
Copy Markdown
Member

The regenerated samples differ only in whitespace

looks good. let's give it a try

@wing328
wing328 merged commit 3a0a3b9 into OpenAPITools:master Nov 24, 2026
78 checks passed
@wing328 wing328 added this to the 7.28.0 milestone Nov 24, 2026
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.

2 participants