Repository navigation
refactor(web_core): read the JSON Schema of catalog schemas, not Zod internals - #25
Closed
louis-bompart wants to merge 5 commits into
Closed
louis-bompart wants to merge 5 commits into
louis-bompart wants to merge 5 commits into
Conversation
…internals GenericBinder, scrapeSchemaBehavior, extractRefFields, getKnownSchemaKeys, the component reference map, the legacy inline catalog and the serializer of a code entry without specification annotations read a schema's JSON Schema view instead of Zod 3 internals. A new a2uiJsonSchemaOf() returns that view: a schema implementing Standard JSON Schema (such as a Zod 4 schema) is converted with normalizeSchema; a Zod 3 schema is converted with zod-to-json-schema, its REF: markers and markChildRef marks becoming $refs and an exclusiveUnion a oneOf. The keywords a spec() annotation adds to a Zod 3 schema are written with it. Components built with other libraries now bind, serialize and report their child references, and data-context no longer imports Zod. The specification shaper (SpecShaper), which computes the published document of a spec()-annotated built-in catalog, still reads Zod 3 and is migrated separately. Part of a2ui-project#2160. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
louis-bompart
marked this pull request as draft
October 27, 2026 23:00
Collaborator
Author
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.
Description
This PR makes
web_coreread a catalog schema's JSON Schema view instead of walking Zod 3 internals. Components built with Standard JSON Schema libraries such as Zod 4, Valibot, and ArkType can bind, serialize, and report child references without the core depending on their implementation details.a2uiJsonSchemaOf(schema)provides that view. It preserves Zod 3REF:markers, child references, exclusive unions, and nestedspec()keywords; the validation-schema generator and catalog serializer now share it.GenericBinderand the component reference map still inspect code entries through the catalog's owntoJson()document, preserving the published-catalog behavior.SpecShaperitself remains a separate later migration layer. This PR does not switch the Basic Catalog generator to Zod 4.Part of a2ui-project#2160.
Pre-launch Checklist
One time:
For this PR:
Tests
@a2ui/web_core: build; full test and conformance run (1267 passing, 0 failing, 21 existing todos); lint with no errors; and format checks.Checkablebinder behavior andChildListcomponent-reference discovery.spec()keywords in generated function validation schemas.