Error responses
When a spec-based mock server answers on its own behalf, and not with a response from your document, it uses application/problem+json (RFC 9457 ). That makes these answers easy to tell apart from your API’s own responses. The type is a link to the matching entry on this page.
{
"type": "https://apigit.com/mock/problems/no-base-path",
"title": "No document is mounted at this path",
"status": 404,
"detail": "No document of this mock is mounted at this path. Base paths: /api/v3.",
"basePaths": ["/api/v3"]
}| Problem | Status | Meaning |
|---|---|---|
no-base-path | 404 | The path is under no base path of the mock |
not-found | 404 | The document has no operation for the path |
method-not-allowed | 405 | The path exists, but not with this method |
not-acceptable | 406 | No response matches the Accept header |
missing-credentials | 401 | The operation needs credentials the request does not have |
invalid-request | 422 | The request does not match the document |
unknown-status | 422 | Prefer: code= names a status the operation does not declare |
unknown-example | 422 | Prefer: example= names an example the response does not declare |
unsupported-mock | 500, 501, 503 | The mock cannot answer this request |
no-base-path
404. The request path is under none of the mock’s base paths. The basePaths field lists them. Check the URL, or change the base path on the mock’s Setting page. See Documents and base paths.
not-found
404. The path is under a base path, but its document has no operation for it. The detail shows the path with the base path removed. List the operations with GET /apigit-mockserver-routes.
method-not-allowed
405. The document declares the path, but not with this method. The Allow header and the allow field list the methods it does declare.
not-acceptable
406. No response media type of the operation matches the Accept header. The available field lists the declared ones.
missing-credentials
401. The operation’s security requires credentials and the request has none of the declared kinds. The schemes field lists what is accepted, and the WWW-Authenticate header names the first. Any value is accepted. Add a placeholder, or use Prefer: validate=parameters,body to skip this check. See Request validation.
invalid-request
422. A parameter or the body does not match the document. The errors field lists each problem with in, name or pointer, and message. See Request validation.
unknown-status
422. Prefer: code= names a status the operation does not declare. The declared field lists those it does. See Responses.
unknown-example
422. Prefer: example= names an example the chosen response does not declare. The examples field lists those it does.
unsupported-mock
The mock could not produce an answer:
- 500: a generated body would exceed the limits, or the mock’s documents could not be loaded. Add an
exampleto the response, or reduce the schema. - 501: the mock uses a type or document kind this version of the platform does not serve.
- 503: a pattern check was temporarily unavailable. Try again.
Other errors
These apply to both types of mock server and use a plain JSON message:
| Status | Message | Meaning |
|---|---|---|
| 401 | Unauthorized: Invalid or missing token | The mock requires an access token |
| 404 | Mockserver info not found for domain: ... | No mock server has this name |
| 429 | Rate limit exceeded: ... | More than 60 requests per second to this mock. The Retry-After header says when to retry. |
| 429 | Quota exceeded. Too many requests. | The plan’s monthly mock server calls are used up |
A code-based mock’s own errors are described in How code-based mocks work.