mirror of https://github.com/kdl-org/kdl.git
move schema to its own file
This commit is contained in:
parent
2516d5ba19
commit
dabdbd3cb8
152
SCHEMA-SPEC.md
152
SCHEMA-SPEC.md
|
|
@ -1,153 +1,3 @@
|
|||
# KDL Schema Specification
|
||||
|
||||
## Example
|
||||
|
||||
```kdl
|
||||
document description="KDL Schema KDL schema in KDL" schema-url="https://github.com/zkat/kdl" {
|
||||
node "document" {
|
||||
min 1
|
||||
max 1
|
||||
prop "schema-url" description="URL where you can find this schema. Informational only." {
|
||||
type "url"
|
||||
}
|
||||
prop "description" description="General purpose and description for this document schema." {
|
||||
type "string"
|
||||
}
|
||||
children id="node-children" {
|
||||
node "node" description="A child node belonging either to `document` or to another `node`. Nodes may be anonymous." {
|
||||
value description="The name of the node. If a node name is not supplied, the node rules apply to _all_ nodes belonging to the parent." {
|
||||
type "string"
|
||||
max 1
|
||||
}
|
||||
prop "description" description="A description of this node's purpose." {
|
||||
type "string"
|
||||
}
|
||||
prop "id" description="globally-unique ID of this node." {
|
||||
type "string"
|
||||
}
|
||||
prop "ref" description="globally unique reference to this node." {
|
||||
type "string"
|
||||
}
|
||||
children {
|
||||
node "enum" description="An enumeration of possible values" {
|
||||
max 1
|
||||
value description="Enumeration choices" {
|
||||
min 1
|
||||
}
|
||||
}
|
||||
node "min" description="minimum number of instances of this node in its parent's children." {
|
||||
max 1
|
||||
value {
|
||||
min 1
|
||||
max 1
|
||||
type "number"
|
||||
}
|
||||
}
|
||||
node "max" description="maximum number of instances of this node in its parent's children." {
|
||||
max 1
|
||||
value {
|
||||
min 1
|
||||
max 1
|
||||
type "number"
|
||||
}
|
||||
}
|
||||
node "prop" description="A node property key/value pair." {
|
||||
value description="The property key." {
|
||||
type "string"
|
||||
min 1
|
||||
max 1
|
||||
}
|
||||
prop "id" description="A globally-unique ID of this property." {
|
||||
type "string"
|
||||
}
|
||||
prop "ref" description="A globally unique reference to another property node." {
|
||||
type "string"
|
||||
}
|
||||
prop "description" description="A description of this property's purpose." {
|
||||
type "string"
|
||||
}
|
||||
children description="Property node children. Only used for validation nodes, for now" {
|
||||
node "type" description="The type for this prop's value." {
|
||||
max 1
|
||||
value {
|
||||
min 1
|
||||
type "string"
|
||||
}
|
||||
}
|
||||
node "enum" description="An enumeration of possible values" {
|
||||
max 1
|
||||
value description="Enumeration choices" {
|
||||
min 1
|
||||
}
|
||||
}
|
||||
node "required" description="Whether this property is required if its parent is present." {
|
||||
max 1
|
||||
value {
|
||||
min 1
|
||||
max 1
|
||||
type "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
node "value" description="one or more direct node values" {
|
||||
prop "id" description="A globally-unique ID of this value." {
|
||||
type "string"
|
||||
}
|
||||
prop "ref" description="A globally unique reference to another value node." {
|
||||
type "string"
|
||||
}
|
||||
prop "description" description="A description of this property's purpose." {
|
||||
type "string"
|
||||
}
|
||||
children description="Value node children. Only used for validation nodes, for now" {
|
||||
node "type" description="The type for this/these value(s)." {
|
||||
max 1
|
||||
value {
|
||||
min 1
|
||||
type "string"
|
||||
}
|
||||
}
|
||||
node "enum" description="An enumeration of possible values" {
|
||||
max 1
|
||||
value description="Enumeration choices" {
|
||||
min 1
|
||||
}
|
||||
}
|
||||
node "min" description="minimum number of values for this node." {
|
||||
max 1
|
||||
value {
|
||||
min 1
|
||||
max 1
|
||||
type "number"
|
||||
}
|
||||
}
|
||||
node "max" description="maximum number of values for this node." {
|
||||
max 1
|
||||
value {
|
||||
min 1
|
||||
max 1
|
||||
type "number"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
node "children" {
|
||||
max 1
|
||||
prop "id" description="A globally-unique ID of this children node." {
|
||||
type "string"
|
||||
}
|
||||
prop "ref" description="A globally unique reference to another children node." {
|
||||
type "string"
|
||||
}
|
||||
prop "description" description="A description of this these children's purpose." {
|
||||
type "string"
|
||||
}
|
||||
children ref="#node-children"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
For the full KDL Schema schema itself, see [examples/kdl-schema.kdl](./examples/kdl-schema.kdl).
|
||||
|
|
|
|||
|
|
@ -0,0 +1,147 @@
|
|||
document description="KDL Schema KDL schema in KDL" schema-url="https://github.com/zkat/kdl" {
|
||||
node "document" {
|
||||
min 1
|
||||
max 1
|
||||
prop "schema-url" description="URL where you can find this schema. Informational only." {
|
||||
type "url"
|
||||
}
|
||||
prop "description" description="General purpose and description for this document schema." {
|
||||
type "string"
|
||||
}
|
||||
children id="node-children" {
|
||||
node "node" description="A child node belonging either to `document` or to another `node`. Nodes may be anonymous." {
|
||||
value description="The name of the node. If a node name is not supplied, the node rules apply to _all_ nodes belonging to the parent." {
|
||||
type "string"
|
||||
max 1
|
||||
}
|
||||
prop "description" description="A description of this node's purpose." {
|
||||
type "string"
|
||||
}
|
||||
prop "id" description="globally-unique ID of this node." {
|
||||
type "string"
|
||||
}
|
||||
prop "ref" description="globally unique reference to this node." {
|
||||
type "string"
|
||||
}
|
||||
children {
|
||||
node "enum" description="An enumeration of possible values" {
|
||||
max 1
|
||||
value description="Enumeration choices" {
|
||||
min 1
|
||||
}
|
||||
}
|
||||
node "min" description="minimum number of instances of this node in its parent's children." {
|
||||
max 1
|
||||
value {
|
||||
min 1
|
||||
max 1
|
||||
type "number"
|
||||
}
|
||||
}
|
||||
node "max" description="maximum number of instances of this node in its parent's children." {
|
||||
max 1
|
||||
value {
|
||||
min 1
|
||||
max 1
|
||||
type "number"
|
||||
}
|
||||
}
|
||||
node "prop" description="A node property key/value pair." {
|
||||
value description="The property key." {
|
||||
type "string"
|
||||
min 1
|
||||
max 1
|
||||
}
|
||||
prop "id" description="A globally-unique ID of this property." {
|
||||
type "string"
|
||||
}
|
||||
prop "ref" description="A globally unique reference to another property node." {
|
||||
type "string"
|
||||
}
|
||||
prop "description" description="A description of this property's purpose." {
|
||||
type "string"
|
||||
}
|
||||
children description="Property node children. Only used for validation nodes, for now" {
|
||||
node "type" description="The type for this prop's value." {
|
||||
max 1
|
||||
value {
|
||||
min 1
|
||||
type "string"
|
||||
}
|
||||
}
|
||||
node "enum" description="An enumeration of possible values" {
|
||||
max 1
|
||||
value description="Enumeration choices" {
|
||||
min 1
|
||||
}
|
||||
}
|
||||
node "required" description="Whether this property is required if its parent is present." {
|
||||
max 1
|
||||
value {
|
||||
min 1
|
||||
max 1
|
||||
type "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
node "value" description="one or more direct node values" {
|
||||
prop "id" description="A globally-unique ID of this value." {
|
||||
type "string"
|
||||
}
|
||||
prop "ref" description="A globally unique reference to another value node." {
|
||||
type "string"
|
||||
}
|
||||
prop "description" description="A description of this property's purpose." {
|
||||
type "string"
|
||||
}
|
||||
children description="Value node children. Only used for validation nodes, for now" {
|
||||
node "type" description="The type for this/these value(s)." {
|
||||
max 1
|
||||
value {
|
||||
min 1
|
||||
type "string"
|
||||
}
|
||||
}
|
||||
node "enum" description="An enumeration of possible values" {
|
||||
max 1
|
||||
value description="Enumeration choices" {
|
||||
min 1
|
||||
}
|
||||
}
|
||||
node "min" description="minimum number of values for this node." {
|
||||
max 1
|
||||
value {
|
||||
min 1
|
||||
max 1
|
||||
type "number"
|
||||
}
|
||||
}
|
||||
node "max" description="maximum number of values for this node." {
|
||||
max 1
|
||||
value {
|
||||
min 1
|
||||
max 1
|
||||
type "number"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
node "children" {
|
||||
max 1
|
||||
prop "id" description="A globally-unique ID of this children node." {
|
||||
type "string"
|
||||
}
|
||||
prop "ref" description="A globally unique reference to another children node." {
|
||||
type "string"
|
||||
}
|
||||
prop "description" description="A description of this these children's purpose." {
|
||||
type "string"
|
||||
}
|
||||
children ref="#node-children"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue