How do I write a custom schema to process both string
-type values, and array of strings, in the same field?
To allow both strings and arrays of strings, use the json
field type. This type accepts any possible json value: boolean
, string
, array
, object
, bigint
, and more!