Skip to content
Download

Match requests to examples

Each example becomes one route, matched on method plus the example’s path template:

Example captured fromRoute
GET https://api.example.com/petsGET /pets
GET https://api.example.com/pets/8123GET /pets/:id
POST https://api.example.com/petsPOST /pets

A literal segment beats a parameter, so /pets/featured wins over /pets/:id regardless of which example was captured first. OpenAPI-style {petId} segments match the same way :petId does.

An example that recorded query parameters only answers requests that carry them. That is how one endpoint serves its empty, its full and its error case:

ExampleAnswers
GET /petsany request to /pets
GET /pets with status=archivedonly /pets?status=archived

When two examples would answer the same request, only the first can ever reply. Kurlo flags this: the Routes header counts the examples that are never reached, and each of them names the example that answers first. Routes are grouped by request. Give them different paths or query values to make the rest reachable.