betto_schema library

Functionality for describing schema, particularly validation of values.

Classes

AdditionalPropertiesRule
Rejects map keys that are not in the declared set.
AdditionalPropertiesSchemaRule
Validates properties not covered by properties or patternProperties against a sub-schema.
AdditionalPropertiesValidator
Validates that a map contains no keys outside allowedProperties.
AlwaysInvalidRule
A sentinel rule that always fails validation with a fixed message.
ArrayRule
Validates array length and per-element schema constraints.
CompositeRule
Runs multiple rules against the same value and collects all violations.
ConstRule
Validates that a value is exactly equal to the schema-declared constant.
ConstValidator<T>
Validates that the input is equal to the specified value.
ContainsRule
Validates that an array contains at least minContains (default 1) and at most maxContains (optional) elements that satisfy itemSchema.
DependentRequired
Validates that, if a map has a specified key then it also has a set of dependent keys.
DependentRequiredRule
Validates conditional property dependencies in an object (map).
DigitString
A string that only contains decimal (0-9)digits.
DOI
Digital Object Identifier (DOI).
Email
An email address.
EnumRule
Validates that a value is one of an enumerated set.
EnumValidator<T>
Validates that the input is one of the specified values
ExactLength
Validates that a string is exactly the specified length
ExclusiveMaximum<T extends num>
Validates that a value is less than the specified max
ExclusiveMinimum<T extends num>
Validates that a value is greater than the specified min
FormatRule
Surface-validates a string against a named format from StringFormatValidator.
GrandfatheredTag
A Grandfathered language tag as per RFC 5646
HexString
Handle a string made up of hexidecimal characters (not witchcraft)
IdnHostname
Validates IDN hostnames with a best-effort Unicode label check.
InRange
Validates that a value is within the specified range
InRangeLength
Ipv6
Validates IPv6 address strings (RFC 4291 ยง2.2).
Isbn13
An International Standard Book Number (ISBN).
Iso8601Duration
Duration ala ISO 8601.
ItemCount<T>
Validates that a list has count items
ItemsValidator<T>
Validates that every element in an iterable satisfies itemValidator.
JsonSchemaValidator
A compiled JSON Schema validator that validates Dart maps against a schema.
LangTag
A normal language tag as per RFC 5646
LanguageTag
A language tag as defined in RFC 5646.
Maximum<T extends num>
Validates that a value is less than or equal to the specified max
MaximumLength
Validates that a string is not longer than the specified maximumLength
MaxItems<T>
Validates that a list has at most max items
MaxProperties
Validates that a map has at most max key/value pairs
Minimum<T extends num>
Validates that a value is greater than or equal to the specified min
MinimumLength
Validates that a string is not shorter than the specified minimumLength
MinItems<T>
Validates that a list has at least min items
MinProperties
Validates that a map has at least min key/value pairs
MultipleOf<T extends num>
Validates that a value is a multiple of the specified divisor.
MultipleOfRule
Validates that a numeric value is a multiple of the schema-declared divisor.
NumericRule
Validates numeric range constraints.
ObjectSizeRule
Validates the number of properties in an object (map).
PatternPropertiesRule
Validates object properties whose names match ECMA-262 regex patterns.
PatternValidator
Validates that a string matches the specified pattern
PrefixItemsRule
Validates array elements positionally against a list of per-index schemas.
PrivateUseTag
A Private Use Tag language tag as per RFC 5646
PropertiesRule
Recursively validates named fields in a map against per-field schemas.
PropertiesValidator
Validates each entry in a map against a per-key Validator.
Required
Validates that a map contains all of the specified properties
RequiredRule
Validates that all named fields are present in a map.
RomanNumerals
Represents a basic Roman numeral-based number
SchemaParser
Parses a JSON Schema subset map into a SchemaRule tree.
SchemaRule
Compiled representation of a JSON Schema keyword group.
SchemaViolation
A single JSON Schema validation failure.
StringFormatValidator
The built-in registry of JSON Schema and project-specific format validators.
StringRule
Validates string length and pattern constraints.
StringValidator
An immutable descriptor for a single named string-format validator.
StringValidatorService
Provides a registry of named string-format validators.
TypeRule
Validates the Dart runtime type of a value against a JSON Schema type.
TypeValidator
Validates that a value matches one of the JSON Schema type strings.
UniqueItems<T>
Validates that a list has a unique set of items.
UniqueItemsRule
Validates that all elements in an array are pairwise distinct.
Urn
A URN is a URI that uses the "urn:" scheme.
Validator<T>
Validators are used to validate data against a schema

Constants

defaultSeparator → const String
The separator used in language tags (-).
irregular → const List<String>
As defined in RFC5646
regular → const List<String>
As defined in RFC5646
romanDigits → const Map<String, int>

Properties

rfc5646extension Rule
final
rfc5646extlang Rule
As defined in RFC5646, Section 2.2.2. Extended language subtags
final
rfc5646grandfathered Rule
As defined in RFC5646, grandfathered tags are still allowed but have generally been deprecated in favour of new subtags
final
rfc5646langtag Rule
final
rfc5646language Rule
final
rfc5646LanguageTag Grammar
The Language Tag syntax as defined in RFC 5646.
final
rfc5646privateuse Rule
final
rfc5646region Rule
final
rfc5646script Rule
final
rfc5646singleton Rule
final
rfc5646variant Rule
final