Background
The Python SDK relies heavily on external JSON Schema definitions to perform strict validation in A2uiValidator and to dynamically discover component references in A2uiStreamParser.
While the C++ SDK passes the same conformance tests and behaves similarly in standard cases, it lacks implementation parity with Python. The C++ implementation currently relies on manual traversal, hardcoded checks, and heuristics rather than dynamic schema analysis. This makes the C++ version more lenient on malformed payloads and less adaptable to custom component schemas.
The root cause is that the current C++ json-schema-validator library only supports Draft 7 of JSON schema, but not Draft 2020-12 support yet, pboettch/json-schema-validator#373, while the A2UI v0.9 spec uses Draft 2020-12 features like $defs.
As of today (April 23, 2026), the only C++ library that specifically lists support for Draft 2020-12 is jsoncons. However, it is not available in the internal Google codebase. Therefore, we decided to stick to the current manual validation approach.
Proposal
Once a C++ library supporting Draft 2020-12 becomes available (or if jsoncons can be introduced into the codebase), we should:
- Refactor A2uiValidator to use the JSON Schema library for structural validation, bringing it to full feature and implementation parity with Python.
- Refactor A2uiStreamParser (specifically get_reachable_components) to use schema analysis for discovering reference fields (like child, children, etc.) instead of relying on hardcoded heuristics.
Background
The Python SDK relies heavily on external JSON Schema definitions to perform strict validation in A2uiValidator and to dynamically discover component references in A2uiStreamParser.
While the C++ SDK passes the same conformance tests and behaves similarly in standard cases, it lacks implementation parity with Python. The C++ implementation currently relies on manual traversal, hardcoded checks, and heuristics rather than dynamic schema analysis. This makes the C++ version more lenient on malformed payloads and less adaptable to custom component schemas.
The root cause is that the current C++
json-schema-validatorlibrary only supports Draft 7 of JSON schema, but not Draft 2020-12 support yet, pboettch/json-schema-validator#373, while the A2UI v0.9 spec uses Draft 2020-12 features like$defs.As of today (April 23, 2026), the only C++ library that specifically lists support for Draft 2020-12 is jsoncons. However, it is not available in the internal Google codebase. Therefore, we decided to stick to the current manual validation approach.
Proposal
Once a C++ library supporting Draft 2020-12 becomes available (or if jsoncons can be introduced into the codebase), we should: