Skip to content
Playground(another site)

bynk.types.field_annotation_unknown

Error A record field carries an annotation other than @name("…").

@name("…") is the only annotation a record field takes: it gives the field the key it has on an HTTP request where that key is not an identifier. Any other annotation is refused rather than ignored, so a misspelt one cannot silently do nothing. Write @name, or drop the annotation.

Example

type Filter = {
@rename("page-size") pageSize: Option[Int], // ✗ only `@name` exists
}
type Filter = {
@name("page-size") pageSize: Option[Int], // ✓
}

In the Book

See also

  • The grammar rule it governs: record_field.
  • Every code in its category, Type checking, on the diagnostic index.
  • bynk explain bynk.types.field_annotation_unknown shows the same from the installed toolchain, without a network.