Skip to content
Playground(another site)

bynk.event.bad_schema_version

Error An event's @schema(N) annotation is malformed — N must be a single, positive, positional Int literal, and @schema may appear at most once on an event.

@schema(N) states the version an event is at, so that the number can be reviewed in the source and is checked against the version the registry computes. N must be one positive Int literal, given by position, and @schema may appear once on an event: @schema(0), @schema("2"), @schema(v: 2) and a second @schema are all refused. Write @schema(2), or drop the annotation, since the registry tracks the version anyway.

Example

event Paid @schema(0) = { // ✗ versions start at 1
event Paid @schema(1) = { // ✓
id: String,
}
const Version: Int = 1
event Refunded @schema(Version) = { // ✓ an `Int` constant bound to a literal
id: String,
}

In the Book

See also

  • Every code in its category, Events, on the diagnostic index.
  • bynk explain bynk.event.bad_schema_version shows the same from the installed toolchain, without a network.