Repository navigation
Conversation
This was referenced Oct 3, 2026
gsmith85
force-pushed
the
feat/codegen-ast-reify
branch
from
October 3, 2026 02:03
63a971e to
8ebe945
Compare
gsmith85
force-pushed
the
feat/codegen-open-unions
branch
from
October 3, 2026 02:07
33e031a to
233fbe2
Compare
gsmith85
force-pushed
the
feat/codegen-open-unions
branch
from
October 5, 2026 23:57
233fbe2 to
9971a9c
Compare
gsmith85
force-pushed
the
feat/codegen-ast-reify
branch
from
October 6, 2026 00:12
a9d9753 to
57d290f
Compare
gsmith85
force-pushed
the
feat/codegen-open-unions
branch
2 times, most recently
from
October 7, 2026 06:00
7940a92 to
cd8c9b3
Compare
gsmith85
force-pushed
the
feat/codegen-ast-reify
branch
from
October 7, 2026 06:00
57d290f to
63aa281
Compare
This was referenced Oct 7, 2026
Open
gsmith85
force-pushed
the
feat/codegen-ast-reify
branch
from
October 7, 2026 22:04
63aa281 to
831c2df
Compare
gsmith85
force-pushed
the
feat/codegen-open-unions
branch
from
October 7, 2026 22:04
cd8c9b3 to
ff6d9c1
Compare
…yOf with <Union>Base
gsmith85
force-pushed
the
feat/codegen-open-unions
branch
from
October 8, 2026 00:32
ff6d9c1 to
792c4ed
Compare
gsmith85
force-pushed
the
feat/codegen-ast-reify
branch
from
October 8, 2026 00:32
831c2df to
2d102e4
Compare
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.
Working...
Summary
Implements Task 7 (PR 3b) of the two-layer
ucp-schemacode-generation pipeline: open string discriminator union lowering (lower_conditional_unionsinsrc/codegen/reify.rs), stacked on #86.Changes
allOfif/then.$refUnion Lowering (src/codegen/reify.rs):allOfbranches consist ofif: { properties: { <disc>: { const | enum([single]) } } }paired withthen: { "$ref": "#/$defs/<Variant>" }.propertiesandrequiredinto each referenced variant definition, removes any back-reference{"$ref": "#/$defs/<ParentName>"}from the variant'sallOf, sets the variant's discriminator property to{"type": "string", "const": "<tag>"}, and strips"default"from variant discriminator properties (invariantOU-4).OU-1throughOU-4):type == "string"withoutconstorenum, or a$refto such a string schema likeReverseDomainName), synthesizes<ParentName>Basein$defswith all base properties,additionalProperties: true, and<disc>: { "type": "string", ..., "not": { "enum": [<sorted_known_tags>] } }(invariantOU-2), and strips"default"from the base discriminator property (invariantOU-4).<ParentName>to an orderedanyOfcontaining sorted$refs to the known variants followed by{"$ref": "#/$defs/<ParentName>Base"}as the final fallback branch (invariantOU-1), without emitting the OpenAPI"discriminator"keyword (invariantOU-3).enumorconst), emitsanyOfwith only the sorted variant$refs and no<ParentName>Basedefinition.Stacked PR Series Roadmap
$refrewriting (src/codegen/normalizer.rs)$refalignment (src/codegen/normalizer.rs)generate_types()library API (src/codegen/{mod,reachability,hoist,compose}.rs)generate-typessubcommand (src/bin/ucp-schema.rs,tests/generate_types_test.rs).well-known/ucp--profilescoping (src/codegen/profile.rs)src/codegen/normalizer.rs,src/codegen/reify.rs)<Union>Base) (src/codegen/reify.rs)src/codegen/reify.rs)generate_models.sh,postprocess_models.py,src/ucp_sdk/models/)generate_models.sh,scripts/generate-zod-from-types.mjs,src/spec_generated.ts)ucp-schema generate-openapi,src/openapi/mod.rs)Test Plan
cargo fmt --checkcargo test --all-targetscargo clippy --all-targets -- -D warnings