@spice json encoding variant with record

I am looking for help using @spice to encode/decode JSON using variants with records in their constructors:

@spice
type divider = {
  height: int,
  topBorder: bool,
  bottomBorder: bool,
  borderWidth: borderWidth,
  fullWidth: bool,
  layout: layout,
}

@spice
type blockType =
  | @spice.as("DIVIDER") Divider(divider)

@spice
type block = {
  id: string,
  priority: int,
  blockType: blockType,
}

Thanks in advance!