hen 0.20.2

Run protocol-aware API request collections from the command line or through MCP.
Documentation
name = Imported OpenAPI Collection
description = Generated by `hen import` from an OpenAPI contract.

scalar BankCheckout_accountId = string & len(6..)

scalar BankCheckout_method = string & const("bank")

scalar CardCheckout_cardLast4 = string & len(4..4)

scalar CardCheckout_method = string & const("card")

schema Animal = oneOf(Cat, Dog)

schema BankCheckout {
  accountId: BankCheckout_accountId
  method: BankCheckout_method
}

schema CardCheckout {
  cardLast4: CardCheckout_cardLast4
  method: CardCheckout_method
}

schema Cat {
  id: UUID
  lives: integer
}

schema Checkout = discriminator(method,
  "bank": BankCheckout,
  "card": CardCheckout
)

schema Dog {
  breed: string
  id: UUID
}

schema Result = oneOf(Animal, Checkout)
---

createCheckout

POST https://example.com/api/checkout

~~~json
{
  "cardLast4": "example",
  "method": "card"
}
~~~

^ & body === Result