Decision records · Types the tables leave open
D-022 What type does geo take when § 5.5 lets it declare either the selectable structure or allowed[]?
What the schemas do
An untagged union of its selectable form and its settable form. A validator tells them apart, because each is closed and requires a different key.
Options
Why
With the open PRs, geo is marked selectable, but § 5.5 says a geo that declares only allowed[] is settable and that it must not declare both, and the display example declares allowed[]. The marker can't decide the type, so geo is Geo, anyOf the copies GeoSelection and GeoBounds, both of geo codes, ExternalId (D-019). The copies are closed and require available[] and allowed[], so no value fits both, which is § 5.5's "MUST NOT declare both". On main, geo is settable only. This is a fourth untagged union beside the three type rules § 8 lists.
What we ask the specification to state
Give geo one marker, or a tag that says which structure it declares. It is the only field whose marker depends on its content.
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
georow L258 at 44dfaafgeo| Object | settable |allowed[]of geo codes the buyer may select within
With the open PRs
§ 5.5, the
georow L260 in #72geo| Object | selectable |available[]of geo codes withincluded[],pricingdeltas andmax_select(§ 3.1), for a line item priced by market. Ageothat declares onlyallowed[]issettable. See below§ 5.5, a requirement
geoMAY instead declare the selectable structure of § 3.1, so a line item can be priced by market.The integration of the open PRs wrote this text, to resolve a conflict or as its lock records, so no commit on GitHub holds it.
§ 5.5, a requirement L265 in #72
A seller whose rate differs by market MAY declare
geowith the selectable structure of § 3.1:§ 5.5, a requirement L276 in #72
A
geothat declaresallowed[]and noavailable[]MUST be treated assettable(§ 3.2).§ 5.5, a requirement L277 in #72
A
geoMUST NOT declare both.
What it shapes
With the open PRs: Geo, LineItem.geo