- GrammarSchema =
Dry::Schema.Params do
config.validate_keys = true
required(:match).array(:str?)
required(:template).filled(:string)
end
- LABEL =
/^([A-Z][A-Za-z0-9]+)+$/
- LABEL_LIST =
/^([A-Z][A-Za-z0-9]+)(,\s*([A-Z][A-Za-z0-9]+))*$/
- EDGE_LIST =
/^([A-Za-z\s]+)(,\s*[A-Za-z\s]+)*$/
- IDENT =
/^[A-Za-z]\w*$/
- IDENT_LIST =
/^(\w+)(,\s*\w+)*$/
- DiscourseSchema =
Dry::Schema.Params do
optional(:adapter)
optional(:default).hash do
optional(:label).filled(:string, format?: LABEL)
optional(:attribute).filled(:string, format?: IDENT)
optional(:attributes).filled(:hash) end
optional(:allow_only).hash do
optional(:nodes).filled
optional(:edges).filled
end
optional(:reciprocal).filled(:string, format?: EDGE_LIST)
optional(:grammar).array(GrammarSchema)
end