Skip to content

Stub Quality


When generating from an OpenAPI spec, stubs are populated using the best available data from the spec.

Priority order

PrioritySourceDescription
1Spec examplesUsed verbatim when present in the spec
2Schema example / default / enumFirst value used
3Schema synthesisObjects built from properties, arrays of one item, strings with format hints

Format hints

When synthesising stubs from schema definitions, apitwin uses format hints to produce realistic placeholder values:

Schema formatSynthesised value
uuid"{{uuid}}" — rendered as a real UUID at request time
date-time"{{now}}" — rendered as RFC 3339 timestamp at request time
date"2026-01-01"
email"user@example.com"
uri"https://example.com"

Tips for better stubs

  1. Add examples to your spec — they are used verbatim and produce the highest quality stubs
  2. Use format hintsuuid, date-time, email, etc. produce realistic values
  3. Define default or enum values — the first value is used in the generated stub
  4. Fully define schemas — the more properties and types defined, the better the synthesis

See also: Generate Command | Template Tokens

Released under the MIT License.