CatalogueModule

PackageReified.Constraint

Catalogue

Catalogue is the built-in message catalogue for Reified.Constraint: one canonical source for every interpreted rule's key segments, argument names, neutral English predicate, and plural operand. Violation rendering and the public coverage data both read this table, so a rule cannot ship with its message undeclared. Entries are bare predicates, never whole sentences; the attribute noun and the optional actual-value clause are separate composition entries.

Every built-in key Reified can produce is listed below. Constraint.customLocalized and customLocalizedWith name your own catalogue entries, which no table here can enumerate. actual is not listed as an argument on any predicate: it arrives through the separate constraint.actual entry.

Built-in keys

Key Arguments Plural on Default English
constraint.presence.present n/a n/a must be present
constraint.presence.blank n/a n/a must be blank
constraint.cardinality.exact expected expected must have a size of exactly
constraint.cardinality.minimum minimum minimum must have a size of at least
constraint.cardinality.maximum maximum maximum must have a size of at most
constraint.cardinality.between minimum, maximum n/a must have a size between and
constraint.relation.equal expected n/a must be
constraint.relation.notEqual expected n/a must not be
constraint.relation.greaterThan expected n/a must be greater than
constraint.relation.lessThan expected n/a must be less than
constraint.relation.atLeast expected n/a must be at least
constraint.relation.atMost expected n/a must be at most
constraint.relation.within minimum, maximum n/a must be between and
constraint.membership.oneOf choices n/a must be one of
constraint.membership.noneOf choices n/a must not be one of
constraint.membership.contains item n/a must contain
constraint.membership.notContains item n/a must not contain
constraint.uniqueness n/a n/a must not contain duplicate values
constraint.format.email n/a n/a must be an email address
constraint.format.trimmed n/a n/a must not have leading or trailing whitespace
constraint.format.numeric n/a n/a must contain digits only
constraint.format.alphanumeric n/a n/a must contain letters and digits only
constraint.format.pattern pattern n/a must match
constraint.number.multipleOf divisor n/a must be a multiple of
constraint.number.finite n/a n/a must be a finite number

Unsupported-operand keys

A built-in whose operand Reified cannot describe reports the relation rather than approximating the operand. These carry no arguments:

Key Arguments Plural on Default English
constraint.unsupportedOperand.relation.equal n/a n/a must equal the required value
constraint.unsupportedOperand.relation.notEqual n/a n/a must not equal the excluded value
constraint.unsupportedOperand.relation.greaterThan n/a n/a must be greater than the required value
constraint.unsupportedOperand.relation.lessThan n/a n/a must be less than the required value
constraint.unsupportedOperand.relation.atLeast n/a n/a must be at least the required value
constraint.unsupportedOperand.relation.atMost n/a n/a must be at most the required value
constraint.unsupportedOperand.within n/a n/a must be within the required range
constraint.unsupportedOperand.contains n/a n/a must contain the required value
constraint.unsupportedOperand.multipleOf n/a n/a must be a multiple of the required value

Composition and joining keys

Key Arguments Plural on Default English
constraint.attribute.default n/a n/a value
constraint.actual message, actual n/a , but was
constraint.fullMessage attribute, message n/a
constraint.group.all.pair first, second n/a and
constraint.group.all.start first, rest n/a ,
constraint.group.all.middle first, rest n/a ,
constraint.group.all.end first, second n/a and
constraint.group.any.pair first, second n/a or
constraint.group.any.start first, rest n/a ,
constraint.group.any.middle first, rest n/a ,
constraint.group.any.end first, second n/a or
constraint.list.pair first, second n/a and
constraint.list.start first, rest n/a ,
constraint.list.middle first, rest n/a ,
constraint.list.end first, second n/a and

Runtime access

The same data is available at runtime, so a coverage test never has to copy this page:

let keys : string list = Catalogue.keys
let arguments : Map<string, string list> = Catalogue.arguments
let english : Map<string, string> = Catalogue.english
let pluralArgument : Map<string, string option> = Catalogue.pluralArgument

Arguments are ConstraintValue, the closed value model every interpreter understands: text, char, boolean, integer, decimal, big integer, float, GUID, timespan, date-time, date-time-offset, null, and lists of those. ConstraintValue.render gives the invariant rendering of one; a renderer formats through its value culture instead.

See The key catalogue for how a language skeleton consumes these entries.

Summary

NameSignatureSynopsis
Operations
keysCatalogue.keys Every message key Reified can produce, including the composition and joining entries.
argumentsCatalogue.arguments The argument names each entry's template may interpolate.
englishCatalogue.english The neutral English template for each entry, used when no resource resolves.
pluralArgumentCatalogue.pluralArgument The argument each entry may be pluralized on, when it declares one.

Operations

kind:member

keys

Catalogue.keys
Member
Every message key Reified can produce, including the composition and joining entries.

Returns

string list

Verification Examples

Catalogue.keys |> List.filter (fun key -> not (translations.ContainsKey key))
kind:member

arguments

Catalogue.arguments
Member
The argument names each entry's template may interpolate.

Returns

Map<string, string list>

Verification Examples

Catalogue.arguments.["constraint.cardinality.between"] // [ "minimum"; "maximum" ]
kind:member

english

Catalogue.english
Member
The neutral English template for each entry, used when no resource resolves.

Returns

Map<string, string>

Verification Examples

Catalogue.english.["constraint.presence.present"] // "must be present"
kind:member

pluralArgument

Catalogue.pluralArgument
Member
The argument each entry may be pluralized on, when it declares one.

Returns

Map<string, string option>

Verification Examples

Catalogue.pluralArgument.["constraint.cardinality.minimum"] // Some "minimum"