Module validator

Module validator 

Source
Expand description

Validators for JSON and CBOR data structures

Modules§

cbor
CBOR validation implementation
json
JSON validation implementation

Structs§

EntryCount
Entry count

Enums§

ArrayItemToken

Traits§

Validator
Validator trait. Implemented for JSON documents and CBOR binaries

Functions§

entry_counts_from_group
Retrieve number of group entries from a group. This is currently only used for determining map equality/inequality and for validating the number of entries in arrays, but may be useful in other contexts. The occurrence is only captured for the second element of the CDDL array to avoid ambiguity in non-homogenous array definitions
format_regex
Regex needs to be formatted in a certain way so it can be parsed. See https://github.com/anweiss/cddl/issues/67
generic_params_from_rule
Retrieve the list of generic parameters for a given rule
group_choice_alternates_from_ident
Find all group choice alternate rules from a given identifier
group_rule_from_ident
Find non-group choice alternate rule from a given identifier
ident_matches_bool_value
Does the given boolean identifier match the boolean value
is_ident_any_type
Is the given identifier associated with the any type
is_ident_b64url_data_type
Is the given identifier associated with a b64url data type
is_ident_bool_data_type
Is the given identifier associated with a boolean data type
is_ident_byte_string_data_type
Is the given identifier associated with a byte string data type
is_ident_float_data_type
Is the given identifier associated with a float data type
is_ident_integer_data_type
Is the given identifier associated with an integer data type
is_ident_nint_data_type
Is the given identifier associated with a nint data type
is_ident_null_data_type
Is the given identifier associated with a null data type
is_ident_numeric_data_type
Is the given identifier associated with a numeric data type
is_ident_string_data_type
Is the given identifier associated with a string data type
is_ident_tdate_data_type
Is the given identifier associated with a tdate data type
is_ident_time_data_type
Is the given identifier associated with a time data type
is_ident_uint_data_type
Is the given identifier associated with a uint data type
is_ident_uri_data_type
Is the given identifier associated with a URI data type
rule_from_ident
Find non-choice alternate rule from a given identifier
text_value_from_ident
Find text values from a given identifier
text_value_from_type2
Find text values from a given Type2
type_choice_alternates_from_ident
Find all type choice alternate rules from a given identifier
type_choices_from_group_choice
Convert a given group choice to a list of type choices
type_rule_from_ident
Find non-group choice alternate rule from a given identifier
unwrap_rule_from_ident
Unwrap array, map or tag type rule from ident
validate_array_occurrence
Validate array length and [non]homogeneity based on a given optional occurrence indicator. The first bool in the returned tuple indicates whether or not a subsequent validation of the array’s elements shouch be homogenous. The second bool in the returned tuple indicates whether or not an empty array is allowed during a subsequent validation of the array’s elements.
validate_cbor_from_slice
Validate CBOR slice from a given CDDL document string
validate_entry_count
Validate the number of entries given an array of possible valid entry counts
validate_json_from_str
Validate JSON string from a given CDDL document string