troubleshooting

explain which expectation a recorded request matches now, and why higher-priority ones lost

Re-checks one recorded request, identified by the correlationId of its log entries, against the current expectations in the order MockServer evaluates them. Returns the expectation that would serve the request now, why each expectation evaluated ahead of it was passed over (reason NAMESPACE, INACTIVE, FIELDS_DIFFER, NOT_OPERATOR, CONVERSATION, SCENARIO_STATE or PERCENTAGE, with per-field differences and remediation hints), which lower-priority expectations it shadows, and how the request was handled when it arrived. The result is recomputed on demand, so it reports whether the expectations changed since the request arrived. Values quoting the request are redacted as the event log is. At most 500 expectations are evaluated. With ?narrate=true the response also carries an AI-generated plain-language summary from the configured LLM backend in 'narration'.

put/mockserver/explain

Request

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

Query parameters

correlationIdstring

correlationId of the request's log entries (see PUT /mockserver/retrieve?type=LOGS&format=LOG_ENTRIES); may instead be supplied in the body

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

correlationIdstring

correlationId of the request to explain, when not given as a query parameter

Response

explanation returned

correlationIdstring

the correlationId of the explained request's log entries

timestampstring date-time

when this explanation was computed

recomputedboolean

always true; the explanation is recomputed on demand, not recorded when the request arrived

notestring

a reminder that the result reflects the current expectations, scenario states and remaining Times

sameOutcomeAsAtArrivalboolean

whether the request would be handled the same way now; absent when the outcome at arrival is RESPONDED_WITHOUT_EXPECTATION or UNKNOWN

expectationsChangedSinceboolean

true when the expectations changed at or after the moment the request arrived

expectationsLastChangedstring date-time

when the expectations last changed; absent when they never have

closestExpectationIdstring

when no expectation would serve the request now, the one with the fewest differing fields

totalExpectationsinteger

how many expectations are stored

evaluatedExpectationsinteger

how many expectations were evaluated, at most maxExpectationsEvaluated

truncatedboolean

true when the evaluation budget ran out before every expectation was evaluated

maxExpectationsEvaluatedinteger

the evaluation budget (500); present only when truncated is true

Changes

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