"utc" issues UTC command.
{of s} argument issues checking of EACH element of the list or map
-against the specified schema, or against specified type if "s" is a
-known type.
+against the specified schema "s".
+
+{of type t} argument issues checking of EACH element of the list or map
+against the specified type "t".
"schema-include filename.tcl" command used instead of "field" allows
inclusion of the specified file with the path relative to given schema
test_expect_success "map various" "$SCHEMA_VALIDATE schema.keks e <data.keks"
cat >schema.tcl <<EOF
-e {{field . {map} {of int}}}
+e {{field . {map} {of type int}}}
EOF
$root/schema.tcl schema.tcl | xxd -r -p >schema.keks
$root/keks.tcl >data.keks.hex <<EOF
test_expect_success "list various" "$SCHEMA_VALIDATE schema.keks e <data.keks"
cat >schema.tcl <<EOF
-e {{field . {list} {of int}}}
+e {{field . {list} {of type int}}}
EOF
$root/schema.tcl schema.tcl | xxd -r -p >schema.keks
$root/keks.tcl >data.keks.hex <<EOF
}
set i [lsearch -glob $args "of *"]
if {$i != -1} {
- set s [lindex [lindex $args $i] 1]
lappend _cmds [EACH]
- variable knownTypes
- if {[lsearch -exact $knownTypes $s] == -1} {
- lappend _cmds [SCHEMA $s]
- } {
- lappend _cmds [TYPE $s]
+ set s [lindex $args $i]
+ if {[llength $s] > 2} {
+ lappend _cmds [TYPE [lindex $s 2]]
+ } else {
+ lappend _cmds [SCHEMA [lindex $s 1]]
}
}
}
{field kem {list} {of kem} >0}
{field id {hexlet} optional}
{field payload {bin} optional}
- {field pubs {list} {of map} optional >0} {# attached public keys}
+ {field pubs {list} {of type map} optional >0} {# attached public keys}
}
dem {
-hashed {{field . {map} {of bin} >0}}
+hashed {{field . {map} {of type bin} >0}}
{field crit {} !exists}
{field ku {set} >0 optional}
{field pub {list} {of av} >0}
- {field sub {map} {of str} >0}
+ {field sub {map} {of type str} >0}
}
signed {
{field load {with load}}
{field sigs {list} {of sig} >0 optional}
- {field pubs {list} {of map} >0 optional}
+ {field pubs {list} {of type map} >0 optional}
}
load {