Skip to content

feat(tii): resolve custom-type params instead of throwing#33

Merged
scarmuega merged 1 commit into
mainfrom
feat/tii-complex-type-schemas
Jun 8, 2026
Merged

feat(tii): resolve custom-type params instead of throwing#33
scarmuega merged 1 commit into
mainfrom
feat/tii-complex-type-schemas

Conversation

@scarmuega

Copy link
Copy Markdown
Contributor

What

Stop throwing on custom-type params, and declare named types in generated
clients.

Why

ParamType.fromJsonSchema threw unsupported type: object / unknown $ref,
so any transaction with a record or variant param broke when building the
param map — custom types were effectively unusable end-to-end.

Changes

  • Map inline object schemas, oneOf (variants), and
    #/components/schemas/... refs to ParamType.custom(schema) (resolving the
    ref against components when provided).
  • Match builtin refs by trailing name so both the …/tii#/$defs/<Name> form
    the emitter produces and the legacy …/core#<Name> form resolve.
  • Thread components through paramsFromSchema.
  • Regenerate the codegen template to declare named types from
    components.schemas.

8 new paramType tests; full unit suite (128) green.

Pairs with tx3-lang/tx3 (emitter + codegen).

Note: variant values still can't round-trip — the resolver-side encoder for
ParamType.custom is the natural follow-up.

🤖 Generated with Claude Code

ParamType.fromJsonSchema threw on object schemas and unknown $refs, so
any transaction with a record/variant param broke when building the
param map. Map inline objects, `oneOf`, and `#/components/schemas` refs
to ParamType.custom (resolving the ref against components when present),
and match builtin refs by trailing name so both the `tii#/$defs/<Name>`
and legacy `core#<Name>` forms resolve. Thread components through
paramsFromSchema. Also regenerate the codegen template to declare named
types from components.schemas.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@scarmuega scarmuega merged commit bd9e965 into main Jun 8, 2026
3 checks passed
@scarmuega scarmuega deleted the feat/tii-complex-type-schemas branch June 8, 2026 23:10
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