Skip to content

Align runtime validation behavior with v0.8 schema expectations for bindable fields#1476

Open
selamw1 wants to merge 3 commits into
mainfrom
fix/v08-payload-validation
Open

Align runtime validation behavior with v0.8 schema expectations for bindable fields#1476
selamw1 wants to merge 3 commits into
mainfrom
fix/v08-payload-validation

Conversation

@selamw1
Copy link
Copy Markdown
Collaborator

@selamw1 selamw1 commented May 20, 2026

Description

Addresses a runtime validation regression introduced in newer @a2ui/react versions when validating spec-compliant A2UI v0.8 payloads.

In @a2ui/react@0.8.0, bindable fields (such as MultipleChoice.selections) containing both path and a literal fallback (e.g., literalArray) were correctly validated, matching the official A2UI v0.8 catalog specification. Later releases introduced a strict refinement (exactlyOneKey) that failed at runtime with Must define exactly one property.

This PR replaces exactlyOneKey with atLeastOneKey for v0.8 bindable properties in @a2ui/web_core. This aligns runtime validation behavior with official v0.8 schema expectations while preserving backwards compatibility for producers emitting both data bindings and literal initial values.

Fixes: #1469

Pre-launch Checklist

  • I signed the [CLA].
  • I read the [Contributors Guide].
  • I read the [Style Guide].
  • I have added updates to the [CHANGELOG].
  • I updated/added relevant documentation.
  • My code changes (if any) have tests.
  • If my branch is on fork, I have verified that scripts/e2e_test.sh passes.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the validation logic in the common types schema to allow at least one property instead of requiring exactly one. This change is applied to several schemas including StringValue, NumberValue, and BooleanValue. The review feedback identifies a logic mismatch in the DataValueMapItemSchema where the condition still checks for exactly one property despite the updated error message, and points out an outdated description string in the ActionSchema that needs to be updated for consistency.

Comment thread renderers/web_core/src/v0_8/schema/common-types.ts
Comment thread renderers/web_core/src/v0_8/schema/common-types.ts Outdated
@selamw1 selamw1 force-pushed the fix/v08-payload-validation branch from 0c1515a to 1e3df2a Compare May 20, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

@a2ui/react 0.10.0 fails v0.8 payload validation for spec-compliant bindable fields (worked on 0.8.0)

1 participant