Decision records · Selectable and settable fields
D-007 Must each included[] entry and each pricing key of a selectable field name an option in available[], and what names an option?
What the schemas do
Yes. Each entry and each key names an option of available[]. A string option is named by its value, so the name is a value of the option's own type. An object option is named by its id, the UUID the seller mints for it.
Options
Why
"Which options are in the base rate" and "Delta per option" only make sense if each entry names an option, and the pricing row names its keys option_id. Every example writes a string option as itself (formats) and an object option by its id (properties, audiences). A position breaks when the seller reorders available[]. JSON Schema can't compare one member with another, so the check is the rule constructor:Selectable:options-named with test vectors. Each entry and key validates as what it names: a string option's name is the option's own value, so a format named in included[] is checked as a format ID, and an object option's name is its id, the identity the seller mints for it, a Uuid (D-037). The template takes that type as its parameter K, which each use gives as the option's type or as Uuid, and its description says what each entry and key names. A name is no type of its own: it validates as the identity it names.
What we ask the specification to state
State that each included[] entry and each pricing key names an option in available[]. A string option is named by its value, and an object option by its id. Also say what names an option given as a catalog_ref. The display example includes ep:smb-decision-makers for the option examplepub/audiences/smb-decision-makers@3, a key that can't be read off the reference.
The specification lines it rests on
Each line is quoted as the record pins it. Expand an item to read the quote.
main
§ 3.1, the
available[]key row L144 at 44dfaafavailable[]| REQUIRED | The options the seller offers§ 3.1, the
included[]key row L145 at 44dfaafincluded[]| REQUIRED | Which options are in the base rate. MAY be empty§ 3.1, the
pricingkey row L146 at 44dfaafpricing| OPTIONAL | Delta per option beyond those included, as{ option_id: { delta_cpm | delta_flat | delta_pct } }
With the open PRs
§ 3.1, the
available[]key row L137 on main at 981a74eavailable[]| REQUIRED | The options the seller offers§ 3.1, the
included[]key row L138 on main at 981a74eincluded[]| REQUIRED | Which options are in the base rate. MAY be empty§ 3.1, the
pricingkey row L139 on main at 981a74epricing| OPTIONAL | Delta per option beyond those included, as{ option_id: { delta_cpm | delta_flat | delta_pct } }
Examples that disagree with the text
| Example | Where | Why | Input |
|---|---|---|---|
examples/line-item-display.yaml | /audiences/included/0 | The text doesn't say what names an option given as a catalog_ref; included[] names the option examplepub/audiences/smb-decision-makers@3 by ep:smb-decision-makers, which no option of available[] is or carries as its id. The text should say what names such an option, and the example should name it that way. | main, open PRs |
What it shapes
main: LineItemSummaryFormatsSelection.included, LineItemSummaryPropertiesSelection.available
With the open PRs: LineItemSummaryEnvironmentsSelection.available, LineItemSummaryFormatsSelection.included, LineItemSummaryPropertiesSelection.available