Repository navigation
fix(schema): mark SessionInfo.additionalDirectories as default-on-null - #2571
Merged
Merged
Conversation
#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>
Open
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.
#2567 made v2
SessionInfo.additionalDirectoriesparsenullas empty (DefaultOnNull). It landed after #2569 added thex-deserialize-default-on-nullhint to everyDefaultOnNullfield, so this one field never got the hint.The TypeScript SDK reads the hint to decide whether
nullmeans empty. Without it, a listed session withadditionalDirectories: nullfails validation.session/listskips invalid entries, so that session drops out of the list instead of showing with no extra roots, as it does in Rust.SessionInfo.additionalDirectories, which updatesschema/v2/schema.jsonandschema/v2/schema.unstable.json.source_default_on_null_fields_are_schema_annotatedto the schema generator, mirroring the existingDefaultOnErrorcheck, so aDefaultOnNullfield without the hint fails CI. It catches this field when the fix is reverted.Found while updating the SDKs to schema-v1.27.0 / v2.0.0-alpha.10. This needs a schema patch release before the SDKs can pick it up.
npm run checkpasses.