WireMock Stub Builder
Author WireMock mapping JSON with exact request matchers, responses, delays and faults — validated locally and ready to copy.
Stub 1 of 1
0 error(s) · 0 warning(s)Request
Headers
Query parameters
Body patterns
Response
Metadata
JSON path checker
Mapping is valid. Ready to copy or download.
Mapping JSON
1 stub(s) · bare mapping{
"request": {
"method": "GET",
"urlPath": "/api/resource"
},
"response": {
"status": 200,
"headers": {
"Content-Type": "application/json"
},
"jsonBody": {
"ok": true
}
},
"name": "stub-1"
}Admin API: curl -X POST "http://localhost:8080/__admin/mappings" -H "Content-Type: application/json" -d @wiremock-mappings.json
Details
Fill in request and response forms and get valid WireMock 3.x mapping JSON. Choose exact URL, path or regex matchers; add header, query and body matchers including equalToJson compare modes and matchesJsonPath; configure status, JSON or text bodies, delays, fault simulation and stateful scenarios. A single stub is emitted as a bare mapping object and multiple stubs as a mappings wrapper, with an admin API curl snippet. Local validation checks JSON bodies, regex patterns and JSONPath expressions before you copy or download; nothing leaves the browser tab.
More examples
GET by regex
urlPathPattern: /api/users/[0-9]+ → 200 JSON bodyA regex URL matcher with a JSON response body, emitted as a bare mapping ready for mappings/.
Header gate
headers: X-Api-Key equalTo secretHeader matchers are emitted under request.headers with equalTo, not the Java DSL's withHeader method.
Stateful flow
scenarioName: checkout; requiredScenarioState: Started; newScenarioState: PaidWireMock scenario keys are top-level scalars, not a nested scenario object.
Examples
Path regex
urlPathPattern: /api/users/[0-9]+"urlPathPattern": "/api/users/[0-9]+"The regex goes directly under request; it is not wrapped in a matcher object.
JSON compare mode
equalToJson {"id":1} with IGNORE_ARRAY_ORDER"jsonCompareMode": "IGNORE_ARRAY_ORDER"Compare modes tune how strictly the expected JSON is matched against the request body.
JSON path preview
$.items[*].id over {items:[{id:1},{id:2}]}Matched 2: 1, 2The local checker supports the common dot/bracket subset; deep scans are only a warning.
About this tool
WireMock Stub Builder turns a form into WireMock 3.x mapping JSON. Choose an exact URL, URL path, path regex or full-URL regex, add header and query matchers, and describe request bodies with equalTo, contains, matches, equalToJson or matchesJsonPath. The emitted keys match the mapping-file schema exactly, including request.headers and top-level scenarioName, requiredScenarioState and newScenarioState.
A single stub is emitted as a bare mapping object — the shape both mappings/ files and POST /__admin/mappings expect. Multiple stubs are wrapped in a { "mappings": […] } file. Responses support status codes, JSON or text bodies, response headers, fixed and distributed delays, faults such as CONNECTION_RESET_BY_PEER, and the response-template transformer.
Local validation runs as you edit: JSON bodies are parsed with an offset, regex patterns are compiled (with an explicit note for Java-only syntax), and matchesJsonPath expressions can be tested against a sample payload using the supported dot/bracket subset. Deep-scan (..) expressions get a warning but still emit valid WireMock matchers.
Four presets — REST CRUD, webhook receiver, chaos faults and a stateful scenario — are one click away. Existing mapping files and admin dumps can be imported back into the form; unknown keys are preserved on export rather than silently dropped. Everything happens in the browser tab, and the curl snippet is displayed, never executed.
What this tool does not do
- The emitter targets WireMock 3.x mapping JSON; extensions and transformers beyond response-template are only preserved on import.
- The local JSONPath checker covers a common subset, not full JsonPath; deep scans are emitted but not previewed.
- Regex validation uses JavaScript's engine, so Java-only constructs are warned about rather than compile-checked.
- The curl snippet is informational; the tool never calls a running WireMock server.
- Workspace stubs are not persisted between visits; export your mapping file to keep them.
How to use this tool
Describe the request
Pick a URL matcher type and pattern, choose the HTTP method, then add header, query and body matcher rows as needed.
Configure the response
Set status, body and headers. Add a fixed delay or distribution, a fault for resilience tests, or enable the response-template transformer.
Add metadata
Name the stub, set priority (lower wins), and configure scenario states for stateful flows.
Validate and check paths
Read the validation strip for JSON or regex errors. Paste a sample payload in the JSON path checker and click Test match to preview extracted values.
Export or import
Copy or download the mapping JSON, or import an existing mappings file (or admin dump) to edit it in the form.
Use cases
CI test doubles
Author deterministic third-party stubs with exact header and body matchers for integration tests.
Contract fixtures
Keep request/response examples in WireMock's native format and review them as readable form fields.
Resilience testing
Add delays and faults to exercise client timeouts and retry logic.
Stateful flows
Model multi-step flows with scenario names and state transitions across several stubs.
Matcher keys emitted
| Choice | WireMock JSON |
|---|---|
| equalTo / contains / matches | { "equalTo": "value" } and friends |
| equalToJson | { "equalToJson": {…}, "jsonCompareMode": "IGNORE_ARRAY_ORDER" } |
| matchesJsonPath | { "matchesJsonPath": "$.items[*].id" } or an expression + inner matcher object |
| headers / queryParameters | request.headers = { "Name": [{ matcher }] } |
| delays and faults | response.fixedDelayMilliseconds, response.delayDistribution, response.fault |
| scenario | Top-level scenarioName, requiredScenarioState and newScenarioState |
Single stubs export as a bare mapping; two or more export inside a mappings wrapper file.
Common mistakes
Mistake:Wrapping a single mapping in a mappings array.
Fix:Single stubs export as a bare object; only multi-stub files use the wrapper.
Mistake:Using withHeader or a nested scenario object.
Fix:Mapping JSON uses request.headers and top-level scenarioName/requiredScenarioState/newScenarioState.
Mistake:Using randomDelay instead of delayDistribution.
Fix:The mapping schema uses response.delayDistribution with a type discriminator.
Mistake:Believing a Java regex that fails in JavaScript is invalid.
Fix:The validator flags Java-only syntax as a warning; WireMock's Java engine still accepts it.
Mistake:Expecting deep JSONPath scans to be checked locally.
Fix:The checker covers $, .key, [n], [*] and bracket keys; .. is warned about but emitted unchanged.
Frequently asked questions
What is the difference between url and urlPathPattern?
url matches the complete URL including the query string, urlPath matches just the path exactly, urlPathPattern applies a regex to the path only, and urlPattern applies a regex to the full URL. The builder emits the key you choose directly under request; a single stub exports as a bare mapping object.
How does matchesJsonPath work?
matchesJsonPath extracts a value from the request body using a JsonPath expression and optionally matches it with an inner matcher such as equalTo. The local checker supports $, .key, [n], [*] and bracket keys so you can preview extracted values against a sample payload. Deep scans like $..price are warned about but emitted unchanged — WireMock's full JsonPath engine handles them at runtime.
How do I set stub priority?
Enter a number in Metadata. Lower numbers win: WireMock evaluates stubs by priority, then by insertion order, so the first matching stub with the lowest priority serves the request. The builder warns when two stubs share both a pattern and a priority.
How do stateful scenarios work?
Give several stubs the same scenarioName, then set requiredScenarioState on each and newScenarioState where the state should advance. WireMock starts from the state Started. The emitted keys are top-level scalars (scenarioName, requiredScenarioState, newScenarioState), and the tool reports an error if you configure states without a scenario name.
How do I deploy the JSON to WireMock?
Download the mapping file and drop a single bare mapping into your mappings/ directory, or put a multi-stub mappings wrapper there. For a running server, the displayed curl snippet POSTs the file to /__admin/mappings. The snippet is shown as text and is never executed by the tool.
Does my stub data leave the browser?
No. Building, validation, JSONPath preview and import all run locally. Stub bodies often contain internal API shapes, so nothing is uploaded and nothing is persisted on a server. Existing mappings you import stay in the tab until you export them.
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.