Skip to content
Playground(another site)

bynk.http.json_invalid_field

Error A json { } policy's options is not tagged or plain.

The options field of a json { } section says how response bodies write an Option, and it is read at compile time, so its value is the bare word tagged (the default, {"kind": "Some", …}) or plain (Some(v) as v, None as null). Any other word, a string or a computed value is refused. Write one of the two. The route-level form is @json(options: …), checked by bynk.http.json_invalid_arg.

Example

service api from http {
json { options: compact } // ✗ `tagged` or `plain`
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_invalid_field shows the same from the installed toolchain, without a network.