Skip to content
Playground(another site)

bynk.http.limit_on_bodyless

Error A @limit annotation is placed on a handler that takes no body (a GET or DELETE).

@limit caps the size of a request body, so it means something only on a route that reads one: POST, PUT or PATCH. A GET or DELETE takes no body in Bynk, so there is nothing to cap. Move the annotation to the body-taking route, or remove it. A default for every body-taking route in a service goes in limits { maxBody: … }.

Example

@limit(maxBody: 1_000_000) // ✗ a `GET` has no body
on GET("/notes") () -> Effect[HttpResult[String]] by v: Visitor { … }
type Note = { text: String }
@limit(maxBody: 1_000_000) // ✓ a route that reads a body
on POST("/notes") (body: Note) -> Effect[HttpResult[String]] by v: Visitor { … }

In the Book

See also

  • Every code in its category, HTTP, on the diagnostic index.
  • bynk explain bynk.http.limit_on_bodyless shows the same from the installed toolchain, without a network.