OpenProposal 3.0 JSON Schema Unofficial

Decision records · Value formats

D-002 How is a domain spelled, so that two parties compare domains and namespaced terms by string equality?

Gap Decision 2 on the supporting page of #121. Cited on main and with the open PRs.

What the schemas do

One spelling: lowercase ASCII A-labels (Punycode for internationalized names), at least two labels, a top-level label that starts with a letter, and no trailing dot.

Options

  • lowercase-a-label Chosen

    One spelling: lowercase ASCII A-labels (Punycode for internationalized names), at least two labels, a top-level label that starts with a letter, and no trailing dot.

  • any-case

    Any host name spelling, compared case-insensitively by the receiver as DNS does.

Why

DNS compares names case-insensitively (RFC 4343), so Example.com and example.com are one domain. JSON Schema can't compare strings case-insensitively, and NamespacedTerm (type rules § 6) uses the domain as a namespace that receivers compare as strings. One spelling makes string equality correct for Domain and for the namespace of a NamespacedTerm, with no receiver rule. A namespace names the definer's identity domain, so a single label such as localhost is rejected. A top-level label is never all-numeric (RFC 3696 § 2), and every top-level domain in the IANA root zone starts with a letter, including the xn-- ones. Requiring that first letter rejects IP address literals such as 192.168.0.1 and keeps the pattern free of lookahead. This decision covers these two primitives only: a Timestamp has several spellings of one instant and is compared as an instant, and a Url or a Uri is compared as it is written.

What we ask the specification to state

State that a domain is written in lowercase, as ASCII A-labels (RFC 5890), with no trailing dot and not as an IP address. Then domains, app.domain, and namespaced terms compare as plain strings.

The specification lines it rests on

Each line is quoted as the record pins it. Expand an item to read the quote.

main

  • § 5.2, the properties row L225 at 44dfaaf
    properties | Object | selectable | available[] of { id, name, domains, supported_formats }, included[], pricing, max_select

With the open PRs

  • § 5.2, the properties row L225 in #17
    properties | Object | selectable | available[] of { id, name, domains, apps, supported_formats }, included[], pricing, max_select. Each property MUST carry domains, apps or both
  • § 5.2, the apps[].domain key row L238 in #17
    domain | RECOMMENDED | Developer domain, against which app-ads.txt is checked. As app.domain

What it shapes

main: Domain, NamespacedTerm, LineItem.properties

With the open PRs: Domain, NamespacedTerm, AppsEntry.domain, LineItem.properties

The record's YAML file