Skip to main content

Module format

Module format 

Source
Expand description

The string formats a Lexicon format keyword can name.

A lexicon string field may declare a format, and the format is the only part of a string schema that says what the string means rather than how long it is. Most of these already had validators in this workspace, built for the conformance suite before anything called them at a boundary; this module is the boundary, and the four that did not exist — datetime, language, uri and cid — are here.

§An unrecognised format is not an error

StringFormat::parse returns None for a format this build does not know, and check then applies only the string’s length and enumeration rules. New formats are added to the Lexicon specification over time, and a server that refused every record carrying one would break on a schema change it is not even the author of. This is the same forward-compatibility posture as the unknown-property rule, applied one level down.

Modules§

cid
The cid string format: a content identifier, checked by shape only.
datetime
The datetime string format.
language
The language string format: an IETF BCP 47 language tag.
uri
The uri string format: a generic URI, checked loosely on purpose.

Enums§

StringFormat
A format a Lexicon string schema can declare.

Functions§

check
Checks a string against one format, reporting why it failed as prose.
stringly 🔒
Renders one validator’s error as the message a record validator repeats.