Xo is experimental. The source is now public on GitHub, or try Xo in your browser.
Menu · XO0411

Docs

XO0411: two fields have one wire key

error · reported by the checker

A field’s key in derive Json and its column in derive SqlRow is its wire name (kind as "type": Str), else its name under the derive’s case: rule, else its name. Two fields of one struct with the same key would read the same JSON key or column. Give one of them another wire name. See core 2.2.

Example

struct Event {
  kind: Str
  other as "kind": Str
} derive Json

Fix

struct Event {
  kind: Str
  other as "other_kind": Str
} derive Json

Run xo explain XO0411 for this text in a terminal, or see section 10.6 of the specification.