b122de518c
File path = route. JSON/JSON5, dynamic .ts handlers + faker, templating, stateful CRUD (pagination/sort/persist), __variants, sequence, chaos, rate-limit, auth, validation, per-route + global proxy/record, splat routes, X-Scenario overlays, SSE. Visual docs (Scalar) at /__docs from a live OpenAPI 3 spec. OpenAPI import script. Zero-build via tsx. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
19 lines
479 B
Plaintext
19 lines
479 B
Plaintext
{
|
|
// json5: comments + trailing commas + unquoted keys
|
|
// __variants picks the first whose `when` matches the request
|
|
__variants: [
|
|
{
|
|
when: { query: { role: 'admin' } },
|
|
body: { role: 'admin', canDelete: true, seats: 999 },
|
|
},
|
|
{
|
|
when: { headers: { 'x-tier': 'pro' } },
|
|
body: { role: 'user', canDelete: false, seats: 25 },
|
|
},
|
|
{
|
|
// fallback (no `when`)
|
|
body: { role: 'user', canDelete: false, seats: 1 },
|
|
},
|
|
],
|
|
}
|