Decision records · Value formats
D-002 How is a domain spelled, so that two parties compare domains and namespaced terms by string equality?
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
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
propertiesrow L225 at 44dfaafproperties| Object | selectable |available[]of{ id, name, domains, supported_formats },included[],pricing,max_select
With the open PRs
§ 5.2, the
propertiesrow L225 in #17properties| Object | selectable |available[]of{ id, name, domains, apps, supported_formats },included[],pricing,max_select. Each property MUST carrydomains,appsor both§ 5.2, the
apps[].domainkey row L238 in #17domain| RECOMMENDED | Developer domain, against whichapp-ads.txtis checked. Asapp.domain
What it shapes
main: Domain, NamespacedTerm, LineItem.properties
With the open PRs: Domain, NamespacedTerm, AppsEntry.domain, LineItem.properties