Skip to content

fix(schema): support value-type API response results - #173

Merged
iriswolf merged 1 commit into
mainfrom
fix/response-envelope-value-types
Aug 13, 2026
Merged

fix(schema): support value-type API response results#173
iriswolf merged 1 commit into
mainfrom
fix/response-envelope-value-types

Conversation

@iriswolf

Copy link
Copy Markdown
Member

Summary

  • refresh the generated Telegram response envelope with generator contract version 12;
  • allow value-type results such as bool without invalid System.Text.Json metadata;
  • preserve legitimate false results during serialization;
  • prepare aligned package hotfix 1.0.0-alpha.14.1.

Root cause

TelegramApiResponse<TResult>.Result used JsonIgnoreCondition.WhenWritingNull. With an unconstrained generic, TResult? is still a non-nullable value type for TResult = bool, so System.Text.Json rejected the generated contract before serialization or deserialization.

WhenWritingDefault is intentionally not used because Telegram may return a legitimate false result which must remain in the envelope.

Touched public surface

  • generated TelegramApiResponse<TResult> JSON metadata only;
  • no client request path, routing path, transport retry path, or handler dispatch path changed.

Verification

  • generator ./eng/verify.ps1: 7 passed
  • TeleFlow ./eng/verify-release.ps1 -PackageVersion 1.0.0-alpha.14.1 -Configuration Release: 868 passed
  • strict analyzers: 0 warnings, 0 errors
  • package output and metadata verification passed
  • schema guardrails: 793 generated files checked
  • formatting, whitespace, and git diff --check passed

Dependency

Generated from TelegramSchemaGenerator main after IWFTech/TelegramSchemaGenerator#24 was merged.

@iriswolf
iriswolf merged commit 2e867c4 into main Aug 13, 2026
14 checks passed
@iriswolf
iriswolf deleted the fix/response-envelope-value-types branch August 13, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant