bynk.http.json_duplicate
Error A handler carries more than one @json annotation.
@json(options: …) chooses how one route's response bodies write an Option. A handler has one, because two would give the same body two encodings with nothing to say which wins, so the second is refused. Keep the one you mean. To set the encoding for every route of a service, use a json { } section instead. A handler may likewise carry only one @cache (bynk.http.cache_duplicate), @limit or @raw.
Example
@json(options: plain)@json(options: tagged) // ✗ a second `@json`on GET("/activity") () -> Effect[HttpResult[String]] by v: Visitor { … }
@json(options: plain) // ✓on GET("/activity") () -> 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_duplicateshows the same from the installed toolchain, without a network.