Skip to content

A mock never matches and shows a refusal

Before you begin

Role
Editor or higher.

The mock list shows Refused and the editor shows:

The mock server refused this mock

The mock serves no response. Other mocks in the project keep answering; a request that only this mock would have matched follows the project’s unmatched-request behavior.

Open the mock and read the reason beside request. For example, Illegal repetition can mean a path pattern contains {id} as if it were a path template.

  1. Open the mock from the project’s mock list.
  2. Correct the request matcher. For a named path parameter, use a path template such as /users/{id}. For a regular expression, use a pattern such as /users/[0-9]+.
  3. Save the mock and send the request again.

Read the reason beside response in the editor and correct the response field it describes. Save the mock and send the request again. A successful push clears the refusal; another refusal shows the new reason.

Try it reports the refusal reason with a 422 when the mock server cannot accept the preview. A refused preview does not serve the draft.

For an unmatched request, its request-log explanation can name a nearby refused mock and quote the reason. This describes the mock as it is now; it does not prove that its matcher would have taken that request.

mockhub push and mockhub env up print a warning with each mock ID refused during synchronization. The configuration is saved, and other mocks keep answering. The commands exit successfully for the saved configuration; their --report-json output includes refusedMockIds in the apply report. Open a named mock in the dashboard to read its reason, correct it, then push again.

Report a problem with the refusal message and the project’s address.

Report a problem with this page