examples.
Copy. Paste. Run. Real commands, no setup magic.
petstore in one line
mockzilla https://petstore3.swagger.io/api/v3/openapi.json # listening on :2200 curl http://localhost:2200/pet/1 # { "id": 1, "name": "Fluffy", ... }
a local spec, mounted under a path
mockzilla --mount pets/v2 --port 3000 ./openapi.yml curl http://localhost:3000/pets/v2/pet/1
multi-service: one port, many APIs
services/ stripe/openapi.yml twilio/openapi.yml myapp/openapi.yml mockzilla ./services/ # GET /stripe/v1/charges # GET /twilio/2010-04-01/Accounts # GET /myapp/users
simulate latency and errors
mockzilla --latency 100ms --errors p5=500,p10=503 ./openapi.yml
# 5% of calls return 500, 10% return 503
override one endpoint with a static response
pets/ openapi.yml pet/1/index.json # overrides GET /pet/1 pet/post/index.json # overrides POST /pet mockzilla ./pets/
pack a .mockz and ship it
# pack a service folder into a portable archive mockzilla pack ./pets # wrote pets.mockz # run it anywhere, no source folder needed mockzilla pets.mockz # or host it mockzilla https://your.host/pets.mockz
plug it into your tests
# pick a free port, print readiness JSON on first line mockzilla --port 0 --ready-stamp ./openapi.yml # {"event":"ready","port":54213, ...}
simplify a wild spec
# drop unions, cap optional props for tighter mocks
mockzilla simplify --optional 5 --output simplified.yml ./huge-spec.yml
inspect what's in a spec
mockzilla info https://petstore3.swagger.io/api/v3/openapi.json
# JSON summary of services, endpoints, schemas
Need more? Read the full docs, or grab the portable / codegen templates.