Discriminated-union converter for citation objects.
Dispatches based on the type field. For backwards compatibility, objects without an explicit type but with start_char_index/end_char_index are treated as char_location.
type
start_char_index
end_char_index
char_location