Decision records · Changes we propose
D-040 How is a length of time written where the specification or its examples write it as prose, a word, or a count of seconds?
What we propose
An ISO 8601 duration in the grammar of RFC 3339 Appendix A, as hold_duration is.
As written
A production option's lead_time is prose, such as "10 business days"; a report's cadence, an availability's granularity, and a measurement source's attribution_window are bare words, such as daily and 30d; and placement.skipafter and refresh.min_interval_s are whole seconds, as § 5.2.2 and AdCOM 1.0 write them. hold_duration, which the text writes as an ISO 8601 duration, stays one.
The as-written variant takes the option as-written. Switch the type map to As written to see it.
Options
Why
Each of these is a length of time: a production lead time, a reporting option's cadence, the granularity of an availability figure, a measurement's attribution window, how long an ad plays before it may be skipped, and the shortest interval between refreshes. The specification already writes hold_duration as an ISO 8601 duration, so one concept takes one form, and a receiver reads every length of time with one parser. For most of them the text names no form, and the examples write prose, a word, or 30d: "10 business days" and 0 for a lead time, daily for a cadence, and 30d for an attribution window. A frequency cap's period isn't one: it is a calendar period, a term (D-044). For skipafter and min_interval_s the text does name one: § 5.2.2 says its keys follow AdCOM 1.0 and that each takes an integer, and it counts both in seconds, as AdCOM 1.0 and OpenRTB 2.6 write skipafter and minint; no example writes either. The schema departs from both: each is a duration, which a seller converts to whole seconds when it builds a bid request.
What we ask the specification to change
Write every length of time as an ISO 8601 duration, as hold_duration is. That covers a production option's lead_time, a reporting option's cadence, availability's granularity, and a measurement source's attribution_window. It also covers placement.skipafter and refresh.min_interval_s. The examples write "10 business days" and 0 for a lead time. They write daily for a cadence and 30d for an attribution window, which are P1D and P30D as durations. § 5.2.2 writes skipafter and min_interval_s as integer seconds, because AdCOM 1.0 and OpenRTB 2.6 write skipafter and minint that way. A seller that builds a bid request converts each duration to whole seconds, such as PT5S to 5. The _s in min_interval_s names the unit, which a duration carries, so rename the key min_interval. Business days need a calendar the specification doesn't define, so a lead time in business days needs one too.
The specification lines it rests on
Each line is quoted as the record pins it. Expand an item to read the quote.
main
§ 5.4, the
productionrow's description: the inline object L249 at 44dfaaf{ custom_unit, build_owner, lead_time, cost }
§ 5.6, the
availabilityrow's description: the inline object L275 at 44dfaaf{ unit, basis, as_of, granularity, type: forecast | reservable, quantity }
§ 5.7, the
measurement_sourcerow's description: the inline object L321 at 44dfaaf{ vendor, attribution_window, qualifier }
§ 5.7, the
reportingrow's description: the inline object L323 at 44dfaaf{ feed_type: log_level | aggregate | none, cadence, delivery_mechanism, metrics_provided[], latency }
With the open PRs
§ 5.4, the
productionrow's description: the inline object L242 on main at 981a74e{ custom_unit, build_owner, lead_time, cost }
§ 5.2.2, the
placement.skipafterkey row L249 in #120skipafter| OPTIONAL | Whenskipis1: seconds the ad plays before the placement enables skipping |VideoPlacement.skipafter,AudioPlacement.skipafter,video.skipafter§ 5.2.2, the
placement.refreshkey row's meaning: the inline object L252 in #120{ min_interval_s }
§ 5.6, the
availabilityrow's description: the inline object L268 on main at 981a74e{ unit, basis, as_of, granularity, type: forecast | reservable, quantity }
§ 5.7, the
measurement_sourcerow's description: the inline object L314 on main at 981a74e{ vendor, attribution_window, qualifier }
§ 5.7, the
reportingrow's description: the inline object L316 on main at 981a74e{ feed_type: log_level | aggregate | none, cadence, delivery_mechanism, metrics_provided[], latency }
§ 5.2.2, a sentence L233 in #120
Keys follow AdCOM 1.0
Placementand itsDisplayPlacement,VideoPlacementandAudioPlacementsubtypes, and the matching OpenRTB 2.6Impattributes.§ 5.2.2, a requirement L242 in #120
Each key takes an integer, except
playmethod[]andapi[], which take arrays of integers, andrefresh, an object whosemin_interval_sis a REQUIRED integer.§ 5.2.2, the
placement.refreshkey row L252 in #120refresh| OPTIONAL |{ min_interval_s }: minimum seconds a creative renders before the slot refreshes | OpenRTB 2.6 only:imp.refresh.refsettings[].minint
Examples that follow the text, not this change
| Example | Where | Why | Input |
|---|---|---|---|
examples/line-item-audio.yaml | /production/available/0/lead_time | The example follows the text, which gives lead_time no form: it writes 10 business days. We propose an ISO 8601 duration for every length of time; a lead time in business days needs a calendar the specification doesn't define yet. | main, open PRs |
examples/line-item-audio.yaml | /production/available/1/lead_time | The example follows the text, which gives lead_time no form: it writes 0. We propose an ISO 8601 duration for every length of time, P0D here. | main, open PRs |
examples/line-item-display.yaml | /measurement_source/available/0/attribution_window/measurement_source/available/1/attribution_window | The example follows the text, which gives attribution_window no form: it writes 30d. We propose an ISO 8601 duration for every length of time, P30D here. | main, open PRs |
examples/line-item-display.yaml | /reporting/available/0/cadence/reporting/available/1/cadence | The example follows the text, which gives cadence no form: it writes daily. We propose an ISO 8601 duration for every length of time, P1D here. | main, open PRs |
examples/line-item-rewarded-video.yaml | /measurement_source/available/0/attribution_window/measurement_source/available/1/attribution_window | The example follows the text, which gives attribution_window no form: it writes 30d. We propose an ISO 8601 duration for every length of time, P30D here. | open PRs |
What it shapes
main: Availability, MeasurementSourceOption, ProductionOption, ReportingOption, Availability.as_of, Availability.basis, Availability.granularity, Availability.quantity, Availability.type, Availability.unit, MeasurementSourceOption.attribution_window, MeasurementSourceOption.qualifier, MeasurementSourceOption.vendor, ProductionOption.build_owner, ProductionOption.cost, ProductionOption.custom_unit, ProductionOption.lead_time, ReportingOption.cadence, ReportingOption.delivery_mechanism, ReportingOption.feed_type, ReportingOption.latency, ReportingOption.metrics_provided
With the open PRs: Availability, MeasurementSourceOption, ProductionOption, Refresh, ReportingOption, Availability.as_of, Availability.basis, Availability.granularity, Availability.quantity, Availability.type, Availability.unit, MeasurementSourceOption.attribution_window, MeasurementSourceOption.qualifier, MeasurementSourceOption.vendor, Placement.refresh, Placement.skipafter, ProductionOption.build_owner, ProductionOption.cost, ProductionOption.custom_unit, ProductionOption.lead_time, Refresh.min_interval_s, ReportingOption.cadence, ReportingOption.delivery_mechanism, ReportingOption.feed_type, ReportingOption.latency, ReportingOption.metrics_provided