troubleshooting

explain why recent requests did not match any expectation

Returns a diagnostic report for recently recorded unmatched requests, including the closest-matching expectations and the per-field differences that prevented a match. An optional 'limit' in the body bounds how many unmatched requests are analysed (default 10). With 'suggestFixes' set to true, each of the five closest non-matching expectations also carries a 'suggestedFix': an RFC 6902 JSON patch of that expectation (as PUT /mockserver/retrieve?type=active_expectations returns it) that would make it match the request, the fields it patches and cannot patch, and whether the patched expectation matches. Nothing is applied: to apply a fix, patch the retrieved expectation and send it to PUT /mockserver/expectation, which updates the expectation with the same id. Values the event log redacts are never copied into a patch. With ?narrate=true the response also carries an AI-generated plain-language summary from the configured LLM backend in 'narration'.

put/mockserver/explainUnmatched

Request

  • Base URL: http://localhost:1080
  • URL: http://localhost:1080/mockserver/explainUnmatched
  • Auth: none declared

Query parameters

narrateboolean

when true, and the server has llmExplainNarrationEnabled set, also ask the configured LLM backend (llmProvider) for a plain-language summary of the result, returned in 'narration' and labelled as AI-generated; the deterministic fields are returned unchanged. The prompt is redacted before it is sent. When narration is disabled, no LLM backend is configured, or the LLM fails or does not answer within llmRequestTimeoutMillis plus a 2-second grace, 'narration' says why it is unavailable instead

Request body

limitinteger

maximum number of recent unmatched requests to analyse

suggestFixesboolean

add a suggested JSON patch to each of the five closest non-matching expectations

Response

unmatched-request explanation returned

correlationIdstring

a new id for this call, not the id of a recorded request

timestampstring date-time

when this result was computed

unmatchedRequestCountinteger

how many unmatched requests are listed

truncatedboolean

true when the budget of 500 expectation evaluations ran out, so later unmatched requests are left out and the last one listed may have been compared with only some of the expectations

Changes

No recorded changes to this operation across all 1 revision of this API.