Tags
zen/coll
zen/primitive
zen/property
zen/schema
zen/tag
zen/type
zen.tests.schema/test-case
Ns
zen
zen.tests.schema
Symbols
zen/any
zen/boolean
zen/case
zen/coll
zen/ctx
zen/date
zen/datetime
zen/desc
zen/errors
zen/file
zen/integer
zen/keyword
zen/map
zen/name
zen/number
zen/operation
zen/primitive
zen/property
zen/regex
zen/resource
zen/schema
zen/schema-errors
zen/schema-result
zen/set
zen/string
zen/symbol
zen/tag
zen/tags
zen/type
zen/validation-fn
zen/vector
zen.tests.schema/map-exclusive-keys
zen.tests.schema/map-require
zen.tests.schema/str
zen.tests.schema/test-case
zen.tests.schema/valid-schemas
zen
{
tag
{
:zen/tags
#{
tag
:zen/desc
"register resource as a tag"
set
{
:confirms
#{
coll
:zen/tags
#{
schema
coll
type
:type
map
ctx
{
:zen/tags
#{
schema
:type
map
:zen/desc
"schema for context"
:keys
{
:tags
{
:type
set
:every
{
:type
symbol
:symbols
{
:type
map
boolean
{
:zen/tags
#{
schema
type
primitive
:type
map
map
{
:zen/tags
#{
schema
coll
type
:type
map
:keys
{
:key
{
:confirms
#{
schema
:zen/desc
"Validate keys against schema. Turn off unknown-keys validation"
:require
{
:type
set
:zen/desc
"Set of required keys; set means 'one of key' is required."
:every
{
:type
case
:case
[
[0]
{
:when
{
:type
keyword
[1]
{
:when
{
:type
set
:zen/desc
"mean 'one of this keys'"
:every
{
:type
keyword
:keys
{
:type
map
:values
{
:confirms
#{
schema
:type
map
:keys
{
:type
{
:type
symbol
:values
{
:confirms
#{
schema
:exclusive-keys
{
:type
set
:zen/desc
"Set of exclusive groups; each group"
:every
{
:type
set
:minItems
2
:every
{
:type
case
:case
[
[0]
{
:when
{
:type
keyword
[1]
{
:when
{
:type
set
:then
{
:type
set
:every
{
:type
keyword
:schema-key
{
:require
#{
:key
:type
map
:keys
{
:key
{
:type
keyword
:ns
{
:type
string
:zen/desc
"namespace prefix to add to key"
:resolve
{
:type
map
:values
{
:type
symbol
any
{
:zen/tags
#{
schema
type
primitive
:type
zen/map
:zen/desc
"Any type"
tags
{
:zen/tags
#{
schema
property
:type
set
:every
{
:tags
#{
tag
:type
symbol
schema
{
:zen/tags
#{
tag
schema
:type
map
:zen/desc
"zen schema"
:keys
{
:enum
{
:type
vector
:zen/desc
"Check value is in enum"
:every
{
:type
map
:keys
{
:value
{
:type
any
:confirms
{
:type
set
:zen/desc
"set of schemas to confirm"
:every
{
:tags
#{
schema
:type
symbol
:type
{
:tags
#{
type
:type
symbol
:const
{
:type
map
:zen/desc
"Check constant"
:keys
{
:value
{
:type
any
:validation
{
:type
set
:zen/desc
"Custom validation set of functions"
:every
{
:tags
#{
validation-fn
:type
symbol
:schema-key
{
:key
:type
date
{
:zen/tags
#{
schema
type
primitive
:type
map
:keys
{
:in-past
{
:type
boolean
:in-future
{
:type
boolean
validation-fn
{
:zen/tags
#{
tag
schema
:type
map
:zen/desc
"Tag for validation functions"
:keys
{
:handler
{
:type
keyword
errors
{
:confirms
#{
schema-errors
:zen/tags
#{
schema
property
:zen/desc
"resource validation errors while load"
desc
{
:zen/tags
#{
schema
property
:type
string
number
{
:zen/tags
#{
schema
type
primitive
:type
map
:zen/desc
"number primitive type"
:keys
{
:min
{
:type
number
:max
{
:type
number
schema-errors
{
:zen/tags
#{
schema
:type
vector
:every
{
:type
map
:keys
{
:path
{
:type
any
:schema
{
:type
any
:type
{
:type
string
:resource
{
:type
string
:message
{
:type
string
property
{
:zen/tags
#{
zen/tag
:zen/desc
"register tag as a property - i.e. global key with schema"
ns
zen
symbol
{
:zen/tags
#{
schema
type
primitive
:type
map
:keys
{
:tags
{
:type
set
:zen/desc
"Check that symbol registered with specific tags"
:every
{
:type
symbol
name
{
:zen/tags
#{
schema
property
:type
symbol
file
{
:zen/tags
#{
schema
property
:type
string
:zen/desc
"file, namespace was loaded from"
operation
{
:zen/tags
#{
schema
:type
map
:zen/desc
"Basic operation schema"
:keys
{
:params
{
:confirms
#{
schema
:middleware
{
:type
map
:keys
{
:after
{
:type
vector
:before
{
:type
vector
:result
{
:confirms
#{
schema
coll
{
:zen/tags
#{
tag
schema
:type
map
:keys
{
:minItems
{
:min
0
:type
integer
:every
{
:confirms
#{
schema
:maxItems
{
:min
0
:type
integer
type
{
:zen/tags
#{
zen/tag
:zen/desc
"register resource as a schema type"
string
{
:zen/tags
#{
schema
type
primitive
:type
map
:zen/desc
"sring primitive type"
:keys
{
:minLength
{
:min
0
:type
integer
:zen/desc
"inclusive minimal length of string"
:maxLength
{
:min
0
:type
integer
:regex
{
:type
regex
vector
{
:confirms
#{
coll
:zen/tags
#{
schema
coll
type
:type
map
:keys
{
:nth
{
:key
{
:type
integer
:type
map
:values
{
:confirms
#{
schema
primitive
{
:zen/tags
#{
tag
:zen/desc
"Primitive types"
schema-result
{
:zen/tags
#{
schema
:type
map
:keys
{
:errors
{
:confirms
#{
schema-errors
integer
{
:zen/tags
#{
schema
type
primitive
:type
map
:zen/desc
"integer primitive type"
:keys
{
:min
{
:type
integer
:max
{
:type
integer
keyword
{
:zen/tags
#{
schema
type
primitive
:type
map
case
{
:zen/tags
#{
schema
type
:type
map
:zen/desc
"case definition is a collection of pairs :when and :then.\n Starting from first pair, go until first :when schema is valid, then it validates with :then schema"
:keys
{
:case
{
:type
vector
:every
{
:require
#{
:when
:type
map
:keys
{
:when
{
:confirms
#{
schema
:then
{
:confirms
#{
schema
resource
{
:zen/tags
#{
schema
:type
map
:keys
{
:resourceType
{
:type
string
:id
{
:type
string
datetime
{
:zen/tags
#{
schema
type
primitive
:type
map
:keys
{
:in-past
{
:type
boolean
:in-future
{
:type
boolean
regex
{
:zen/tags
#{
schema
type
primitive
:type
map
:zen/desc
"regexp primitive type"