Skip to content

refactor(web_core): allow overriding recursion depth in DataValueSchema for v0_8#1431

Merged
gspencergoog merged 4 commits into
google:mainfrom
gspencergoog:custom_recursion
May 14, 2026
Merged

refactor(web_core): allow overriding recursion depth in DataValueSchema for v0_8#1431
gspencergoog merged 4 commits into
google:mainfrom
gspencergoog:custom_recursion

Conversation

@gspencergoog
Copy link
Copy Markdown
Collaborator

Description

Fixes #1424

This PR allows developers to override the hard-coded recursion depth limit in DataValueSchema while maintaining backward compatibility.

Changes

  • Refactored DataValueSchema in renderers/web_core/src/v0_8/schema/common-types.ts from a static constant to a factory function createDataValueSchema(options?: { maxDepth?: number }).
  • Exported the original DataValueSchema as a constant using the default limit of 5.
  • Added a new test file renderers/web_core/src/v0_8/schema/common-types.test.ts to verify the recursion depth limits.

Impact & Risks

  • Backward Compatibility: The default DataValueSchema behavior is unchanged, so there should be no breaking changes for existing usages.
  • Risk: Low, as it only affects schema validation if someone explicitly opts into a custom depth.

Testing

  • Added new unit tests in common-types.test.ts to verify default and custom depth limits.
  • Ran tests manually using node --test dist/src/v0_8/schema/common-types.test.js.

@github-project-automation github-project-automation Bot moved this to Todo in A2UI May 14, 2026
@gspencergoog gspencergoog requested a review from josemontespg May 14, 2026 16:16
@gspencergoog gspencergoog changed the title refactor(web_core): allow overriding recursion depth in DataValueSchema refactor(web_core): allow overriding recursion depth in DataValueSchema for v0_8 May 14, 2026
gemini-code-assist[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Collaborator

@josemontespg josemontespg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Should we add this change to the changelog?

@gspencergoog
Copy link
Copy Markdown
Collaborator Author

LGTM. Should we add this change to the changelog?

Good idea. Done.

@gspencergoog gspencergoog merged commit 064d95f into google:main May 14, 2026
23 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in A2UI May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Allow a way to bypass DataModel recursion depth check

2 participants