feat: shim the consumer-side tombstone fix too, until faststream releases it - #20
Merged
Merged
Conversation
…ases it (#19) ag2ai/faststream#2933 (Optional[Model] = None resolving correctly for a real tombstone instead of crash-looping on required fields) is open, unmerged, no PyPI release. Producer-side already gets the equivalent treatment via _patch_real_tombstones - do the same here so both halves work today, not just once faststream ships something. Three patches, each guarded for idempotency: - AsyncConfluentParser.parse_message: tags the body with a dedicated TOMBSTONE sentinel (not a byte pattern - can't collide with real content) when the raw value is a genuine null. - AsyncConfluentParser.decode_message: maps TOMBSTONE to None. - faststream._internal.fastapi.route.build_faststream_to_fastapi_parser: a full replacement (it's a per-subscriber closure factory, not a patchable class method) that passes a real None through instead of wrapping it as {param_name: None} - that wrapping is what defeats FastAPI's own no-body shortcut and forces field-level validation on every tombstone. Bumps to 0.4.51. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
aradng
force-pushed
the
fix/revert-git-dep-restore-shim
branch
from
July 13, 2026 19:40
bdafb36 to
5555db7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#19 merged into fix/revert-git-dep-restore-shim (its stacked base) instead of main by mistake - that branch was never subsequently merged into main, so the consumer-side shim never actually landed or published. This is the same content, now targeting main directly.
ag2ai/faststream#2933 (Optional[Model] = None should resolve correctly for a real tombstone instead of crash-looping on required fields) is open upstream, unmerged, no PyPI release either way. The producer side already gets this treatment via
_patch_real_tombstones(0.4.48/0.4.50) - this does the same for the consumer side, so both halves actually work today instead of only the producer.Three patches, each guarded for idempotency:
AsyncConfluentParser.parse_message: tags the body with a dedicatedTOMBSTONEsentinel (not a byte pattern likeb"null"/b""- can't collide with real message content) when the raw value is a genuine null.AsyncConfluentParser.decode_message: mapsTOMBSTONEtoNone.faststream._internal.fastapi.route.build_faststream_to_fastapi_parser: a full replacement, since it's a per-subscriber closure factory rather than a patchable class method. Passes a realNonethrough instead of wrapping it as{param_name: None}- that wrapping is exactly what defeats FastAPI's own no-body shortcut and forces field-level validation on every tombstone instead.Bumps to 0.4.51.
Test plan
tests/kafka/test_tombstone.py:Optional[Model] = Noneresolves toNonefor a real tombstone against a real broker, valid payloads still parse correctly.tests/kafka/suite passes (19/19).