Repository navigation
Conversation
Raw was stored with a type mask of 0, so Optional[Raw] never recorded MS_TYPE_NONE and json/msgpack decode treated null as a Raw payload. Give Raw its own type flag, allow it only in a union with None, and decode null as None while leaving other values as Raw.
3 tasks done
Siyet
requested changes
Sep 9, 2026
Siyet
left a comment
Contributor
There was a problem hiding this comment.
Thx for working on this! Pls rebase on main and preserve the raw diagnostic from #1169, including both raw and null for Raw | None. Also document null handling and supported unions, and add a nullable Raw example to the typing checks.
Preserve Raw and nullable Raw validation diagnostics when resolving conflicts.
sobolevn
requested changes
Nov 9, 2026
sobolevn
left a comment
Member
There was a problem hiding this comment.
I don't think that this should be ever done. Why None is a special value? Why not other unions?
Raw allows you to parse any data for later parsing. Later you can parse None or any other objects and handle them.
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.
Fixes #659.
Support
Raw | None(Optional[Raw]) when decoding JSON and MessagePack. JSONnulland MessagePacknildecode asNone; other values are captured asRaw. Previously, non-null values failed validation for this annotation.Reject unions combining
Rawwith other concrete types, while preserving normalAnynormalization. Add conversion, diagnostic and typing coverage, and document null handling and union restrictions.