Skip to content

docs(examples): add complex-type parameters example#338

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

docs(examples): add complex-type parameters example#338
scarmuega merged 1 commit into
mainfrom
feat/complex-type-params-example

Conversation

@scarmuega

Copy link
Copy Markdown
Contributor

What

Add examples/complex_type_params.tx3 — a single buildable example that
exercises custom types as transaction parameters, which is what drives the
TII components.schemas emission added in #337.

Why

No example in examples/ used a record/variant type as a tx parameter or
env field, so the new schema emission had zero end-to-end coverage there
(only tii::schema unit tests). The two existing files that take custom-type
params (jpg.tx3, levvy.simple.tx3) don't currently parse.

Coverage in one file

  • Record paramOrder → object schema, referenced by $ref
  • Nested recordOrder.asset: AssetClass → recursive $ref, registered once
  • Variant paramSide → tagged oneOf
  • Type aliasLovelace = Int → inlined transparently (no schema of its own)
  • List<Record>place_many(orders: List<Order>) → array whose items is a $ref

Verified: tx3c build … --emit tii yields
components.schemas = { AssetClass, Order, Side } with the expected $refs and
oneOf.

🤖 Generated with Claude Code

No example exercised custom types as transaction parameters, so the TII
`components.schemas` emission had no end-to-end coverage in examples/.

Add complex_type_params.tx3 covering the full surface in one buildable
file: a record param, a nested record (recursive `$ref`), a `oneOf`
variant param, a transparent type alias, and a `List<Record>` param.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@scarmuega scarmuega merged commit 5564c08 into main Jun 8, 2026
6 checks passed
@scarmuega scarmuega deleted the feat/complex-type-params-example branch June 8, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant