OpenProposal 3.0 JSON Schema Unofficial

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[]?

Gap Decision 25 on the supporting page of #121. Cited with the open PRs.

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

  • union Chosen

    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.

  • selectable-only

    The selectable structure only, as its marker says.

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 geo row L258 at 44dfaaf
    geo | Object | settable | allowed[] of geo codes the buyer may select within

With the open PRs

  • § 5.5, the geo row L260 in #72
    geo | Object | selectable | available[] of geo codes with included[], pricing deltas and max_select (§ 3.1), for a line item priced by market. A geo that declares only allowed[] is settable. See below
  • § 5.5, a requirement
    geo MAY 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 geo with the selectable structure of § 3.1:
  • § 5.5, a requirement L276 in #72
    A geo that declares allowed[] and no available[] MUST be treated as settable (§ 3.2).
  • § 5.5, a requirement L277 in #72
    A geo MUST NOT declare both.

What it shapes

With the open PRs: Geo, LineItem.geo

The record's YAML file