also support the case when category is directly specified as a string instead of an array
more test cases
Ugh, we check for required and optional fields, but when we write to the
database we cannot be sure that all fields we intend to write are actually set