Short answer: WireMock matches more conditions than any spec-derived tool, including JSONPath and XPath; a spec mock matches what the contract declares. The first is the right tool for complex matching inside JVM tests; the second is the right surface for keeping every client aligned to the API.

What deep matching is built for

URL patterns, headers, query parameters, body content, JSONPath, and XPath. It is the right tool for a precise, bespoke condition.

What contract matching is built for

PropertyDeep matchingContract matching
ConditionsVery broadDeclared by spec
LanguageJVMAny
ValidityAs writtenBy construction
MaintenanceCodeSpec

Why the declared surface matters

A cross-language team needs every client aligned to the same contract, not to a bespoke JVM condition. The spec mock serves that surface.

The decision rule

Use deep matching for a complex JVM condition. Use contract matching for a shared, language-agnostic target.

This is part of the Powerduck vs WireMock comparison. Next, read contract tests vs stubs.