Skip to content

feat(form): compose schemas and vocabulary across chained extensions - #31

Open
abhinavkdeval08-design wants to merge 1 commit into
runtimeconditions:mainfrom
abhinavkdeval08-design:feat/chained-schema-merging-16
Open

abhinavkdeval08-design wants to merge 1 commit into
runtimeconditions:mainfrom
abhinavkdeval08-design:feat/chained-schema-merging-16

Conversation

@abhinavkdeval08-design

@abhinavkdeval08-design abhinavkdeval08-design commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Part 2 of #16, follows #29. This is the PR that actually calls resolveExtensionChain.

What changed

  • extractConditionForms now takes one extension or an array, plus an optional registry. It resolves spec.dependencies base-first and merges kinds, interfaceTypes, interfaceFields, conditionFields and fieldValues across the chain.
  • ExtensionSchemaItem can omit appliesToKind / appliesToInterfaceType for a shared schema (e.g. configuration-shape in env-configuration). If the owning extension has conditionFields entries for a property, it is only added to the scopes they apply to, so api/webhook doesn't get configuration. If there are no entries for it, it goes everywhere.
  • Schemas for the same (kind, interfaceType) are merged into one form. Scoped refinements (like narrowing property to an enum) are pushed into oneOf variants, and patterns, required flags and base valueDescriptions are kept.
  • ExtractedConditionForm gets appliedExtensionIds and schemaIds. schemaId stays.

Things to know

  • Behavior change: we now return one form per (kind, interfaceType) instead of one per schema item.
  • extensionId on a form is the extension that first introduced that target (the base), not the additive one. appliedExtensionIds lists everything that contributed.
  • When two schemas both use oneOf, variants are paired by index, so they need the same order. Extra incoming variants are kept. An incoming child that matches no variant is dropped. Fine for the current catalog, but worth revisiting.
  • ExtensionDependency.version is still not checked. Catalog IDs already contain the version, so matching by id pins it for now. Range handling should come with the catalog loader.
  • No README/docs change: neither mentions extractConditionForms or spec.dependencies.

Testing

5 new tests in src/form/form.test.ts: env-configuration on common-integrations (array and registry, scope isolation, enum refinement, fieldValues), additive docs precedence, extra oneOf variants, schemaId fallback for a form with no fields, and a missing dependency error. CI passes for root and backend/. npm ci hung on my Windows machine, so I relied on CI for the full run.

Drafted with AI assistance. I reviewed the changes, and CI passes...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant