Comma-delimited strings cannot be indexed for faceted search, cannot be filtered in SQL without LIKE '%value%' scans, and produce false matches (Parking matches No Parking). Consumer APIs that expect arrays get strings and either crash or display literal WiFi, Parking, Outdoor Seating as a single tag. Migrating later requires a string-split backfill that is brittle when values themselves contain commas, and every downstream integration that already parsed the string must be updated simultaneously.
Low because the data is recoverable and rarely user-facing in raw form, but it blocks filtering and structured data generation.
Store multi-value fields as native arrays in Postgres (text[]) or a relational join table, never as delimited strings. Define them as array types in your Prisma schema at prisma/schema.prisma and update API serializers to emit JSON arrays. Migrate existing comma-delimited rows with a one-time SQL job that splits and trims, then drops the old column.
model Listing {
id String @id @default(cuid())
name String
categories String[]
amenities String[]
}
ID: directory-listing-schema.content-completeness.multi-value-arrays
Severity: low
What to look for: List all fields that can contain multiple values (categories, tags, hours, images). For each, check the schema for multi-value fields like categories, amenities, phone numbers, cuisine types, etc. Are they stored as database arrays or strings? Look at JSON responses to see if values are arrays or comma-delimited strings.
Pass criteria: Multi-value fields are stored as arrays in the database and returned as arrays in API responses — 100% of multi-value fields must be stored and rendered as arrays, not comma-separated strings. Report: "X multi-value fields found, all Y use proper array formatting."
Fail criteria: Multi-value fields are stored as comma-delimited strings.
Skip (N/A) when: No multi-value fields exist.
Detail on fail: Example: "Amenities stored as comma-delimited string 'WiFi, Parking, Outdoor Seating'"
Remediation: Store multi-value fields as arrays:
model Listing {
id String @id @default(cuid())
name String
categories String[]
amenities String[]
}