Skip to content

Preserve nullable response and event fields - #2

Merged
kdubb merged 2 commits into
mainfrom
codex/219-preserve-nullable-wire-values
Sep 22, 2026
Merged

kdubb merged 2 commits into
mainfrom
codex/219-preserve-nullable-wire-values

Conversation

@kdubb

@kdubb kdubb commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Response codecs, server-sent events, and Litestar problem responses applied blanket null exclusion, dropping explicit null even when a generated field permits or requires it. Preserve nullable values and let field-level Pydantic metadata decide which absent properties to omit. Standard RFC problem fields keep individual null-omission metadata.

Companion runtime fix for outfoxx/sunday-generator#220, discovered while auditing outfoxx/sunday-generator#219 across all generated languages. Request and merge-patch presence behavior is unchanged. The generator change adds omission metadata for optional non-nullable fields; deploy regenerated models with the updated runtime for complete response behavior.

Validation: Ruff lint and format checks, mypy across source, tests, and tools (40 files), and all 119 pytest tests passed with 91.75% coverage. Regression coverage includes required/optional nullable fields, aliases, nested values, empty/zero/false values, SSE, and nullable problem extensions.

Use model field exclusion metadata instead of blanket null filtering for response codecs, SSE, and problem responses. Omit absent standard problem fields individually and cover nullable fields, aliases, nesting, and valid empty values.
Construct test models with their typed Python field names and annotate the expected JSON mapping. Preserve alias assertions on the serialized wire output.
@kdubb
kdubb marked this pull request as ready for review September 22, 2026 21:42
@kdubb
kdubb merged commit 0b76aa1 into main Sep 22, 2026
5 checks passed
@kdubb
kdubb deleted the codex/219-preserve-nullable-wire-values branch September 22, 2026 21:45
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