Skip to content

499 - API Mock

Mock API response payloads for testing. This is an example of a MAML document.

maml
# Mock API definition
{
  endpoint: "/api/v1/users"
  method: "GET"
  status: 200
  # JSON response body
  response: """
[
  {
    "id": 1,
    "name": "Arlene Purdy Sr.",
    "email": "Tracey.Jacobson66@yahoo.com",
    "role": "admin"
  },
  {
    "id": 2,
    "name": "Alton Graham",
    "email": "Marian_Schaefer@gmail.com",
    "role": "user"
  }
]
"""

  # Response headers
  headers: {
    Content-Type: "application/json"
    X-Total-Count: "2"
    X-Request-Id: "05311e55-82d2-4866-b36a-fffee24a23f4"
  }
  delay_ms: 62 # simulated latency
}

See Also