Skip to content
Playground(another site)

bynk.http.json_unknown_field

Error A json { } policy declares a field outside the closed set (options).

A json { } section sets how every route of a service writes an Option in a response body, and options is its only field. The set is closed, so a misspelt or invented field is refused rather than ignored, which would leave the service writing bodies otherwise than you wrote. Rename it to options or remove it. A bad value is bynk.http.json_invalid_field; the route-level @json form is bynk.http.json_unknown_arg.

Example

service api from http {
json { options: plain, nulls: keep } // ✗ `options` is the only field
on GET("/items") () -> Effect[HttpResult[String]] by v: Visitor { … }
}
service api from http {
json { options: plain } // ✓
on GET("/items") () -> 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.json_unknown_field shows the same from the installed toolchain, without a network.