Repository navigation
docs(schema): mark DefaultOnNull lists with an x-deserialize hint - #2569
Merged
Merged
Conversation
benbrandt
enabled auto-merge (squash)
October 27, 2026 21:38
Merged
This was referenced Oct 27, 2026
benbrandt
added a commit
that referenced
this pull request
Oct 28, 2026
#2571) #2567 made v2 SessionInfo.additionalDirectories parse null as empty but landed after #2569 added the x-deserialize-default-on-null hint, so the field missed it. Generated parsers that read the hint (the TypeScript SDK) then reject null there, and because session/list skips invalid entries, the whole session drops out of the list instead of listing with no roots. Add the hint and a schema-generator test, like the existing DefaultOnError one, that fails when a DefaultOnNull field has no hint. Co-authored-by: Claude <noreply@anthropic.com>
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.
Some list fields use
DefaultOnNull, which Rust accepts as empty, but the JSON schema showed them as plain non-nullable arrays with no hint. Examples:mcpServers,additionalDirectories, terminal authargs/env, and MCPargs/env/headers. Schema-generated receivers rejectednullwhile Rust accepted it.This adds an
x-deserialize-default-on-nullschema hint to everyDefaultOnNullfield, alongside the existingx-deserialize-default-on-errorandx-deserialize-skip-invalid-itemshints. The leniency stays out of the spec prose, andnullremains invalid for senders.Applied to v1 and v2, since it's schema metadata only (27 fields).