mix bazaar.gen.schema (Bazaar v0.3.0)

Copy Markdown View Source

Generates Elixir schema modules from UCP JSON Schema files.

$ mix bazaar.gen.schema priv/ucp_schemas/2026-08-25/shopping/types/buyer.json

This will output Elixir code that can be copied into your schema modules.

Options

  • --module - Module name for the generated schema (optional)
  • --output - Output file path (optional, defaults to stdout)

Examples

# Generate to stdout
$ mix bazaar.gen.schema priv/ucp_schemas/2026-08-25/shopping/types/total_resp.json

# Generate with module name
$ mix bazaar.gen.schema priv/ucp_schemas/2026-08-25/shopping/types/buyer.json --module Bazaar.Schemas.Buyer

# Generate to file
$ mix bazaar.gen.schema priv/ucp_schemas/2026-08-25/shopping/checkout_resp.json --output lib/bazaar/schemas/ucp/shopping/checkout.ex