Skip to content
Playground(another site)

bynk.http.extra_param

Error A handler parameter is not a path parameter, body, headers or query.

A handler's parameters are not free-form. Each is a path parameter, matching a :name in the route, or one of the three the router fills itself: body, headers and query. Any other name has nowhere to come from. Read a value from the query string with query: RequestQuery or a record, move it into the path, or drop it. A :name with no parameter is bynk.http.unbound_path_param.

Example

on GET("/items") (page: String) -> Effect[HttpResult[String]] by v: Visitor { … } // ✗ not in the path, and not `body`, `headers` or `query`
on GET("/items") (query: RequestQuery) -> Effect[HttpResult[String]] by v: Visitor { … } // ✓

In the Book

See also

  • The grammar rule it governs: http_handler.
  • Every code in its category, HTTP, on the diagnostic index.
  • bynk explain bynk.http.extra_param shows the same from the installed toolchain, without a network.