Decision records · Value formats
D-045 May a daypart window's days[] be empty, or name one day twice?
What the schemas do
days[] names at least one day, and each day at most once.
Options
Why
The text writes days[] and says which values it takes, not how many, so neither bound is the text's. A window applies on each day it names, so a window with no day never applies, and an allowed window that never applies offers the buyer nothing; a day named twice adds no day to the window. Google Ad Manager, whose day part the window follows (D-004), shows the first bound: a DayPart holds one dayOfWeek, "Day of the week the target applies to. This field is required.", so a day part with no day can't be written there, and a window of several days is one day part for each day. Ad Manager has no list of days in which a day could repeat, so the second bound rests on the window's meaning alone. The schema states both on the list, minItems: 1 and uniqueItems: true, and the list stays a list, not a set, so its order is the writer's.
What we ask the specification to state
Say that a daypart window's days[] names at least one day, and each day at most once.
The specification lines it rests on
Each line is quoted as the record pins it. Expand an item to read the quote.
main
§ 5.5, the
daypartrow L260 at 44dfaafdaypart| Object | settable |allowed[]of time windows
With the open PRs
§ 5.5, the
daypartrow L260 in #123daypart| Object | settable |allowed[]of{ days[], start, end }:days[]frommonday|tuesday|wednesday|thursday|friday|saturday|sunday, HH:MM civil time,endexclusive, up to24:00§ 5.5, a sentence L264 in #123
A
daypartwindow is{ days[], start, end }, withdays[]from Monday to Sunday,startandendas HH:MM, andendexclusive, later thanstart, and allowed to be24:00.
What it shapes
main: DaypartWindow, LineItem.daypart
With the open PRs: DaypartWindow, LineItem.daypart