116 lines
2.3 KiB
JSON
116 lines
2.3 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://scient.ing/ns/schemas/anchor.schema.json",
|
|
"title": "Anchor",
|
|
"description": "scienting-anchor/1: a pinned address with context; spec/06-anchors.md.",
|
|
"type": "object",
|
|
"properties": {
|
|
"format": {
|
|
"const": "scienting-anchor/1"
|
|
},
|
|
"store": {
|
|
"$ref": "common.schema.json#/$defs/key"
|
|
},
|
|
"doc": {
|
|
"$ref": "common.schema.json#/$defs/key"
|
|
},
|
|
"node": {
|
|
"$ref": "common.schema.json#/$defs/nodeRef"
|
|
},
|
|
"kind": {
|
|
"$ref": "common.schema.json#/$defs/nodeKind"
|
|
},
|
|
"own_hash": {
|
|
"$ref": "common.schema.json#/$defs/hash"
|
|
},
|
|
"node_hash": {
|
|
"$ref": "common.schema.json#/$defs/hash"
|
|
},
|
|
"span": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer",
|
|
"minimum": 0
|
|
},
|
|
"minItems": 2,
|
|
"maxItems": 2
|
|
},
|
|
"quote": {},
|
|
"context": {},
|
|
"leaves": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "array",
|
|
"prefixItems": [
|
|
{
|
|
"$ref": "common.schema.json#/$defs/nodeId"
|
|
},
|
|
{
|
|
"$ref": "common.schema.json#/$defs/hash"
|
|
}
|
|
],
|
|
"minItems": 2,
|
|
"maxItems": 2
|
|
},
|
|
"minItems": 1
|
|
},
|
|
"rev": {
|
|
"type": "integer",
|
|
"minimum": 0
|
|
},
|
|
"keyed": {
|
|
"$ref": "common.schema.json#/$defs/hashing"
|
|
}
|
|
},
|
|
"required": [
|
|
"format",
|
|
"doc",
|
|
"node",
|
|
"own_hash",
|
|
"node_hash",
|
|
"rev"
|
|
],
|
|
"additionalProperties": false,
|
|
"allOf": [
|
|
{
|
|
"if": {
|
|
"required": [
|
|
"keyed"
|
|
]
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"quote": {
|
|
"$ref": "common.schema.json#/$defs/keyedQuote"
|
|
},
|
|
"context": {
|
|
"$ref": "common.schema.json#/$defs/keyedContext"
|
|
}
|
|
}
|
|
},
|
|
"else": {
|
|
"properties": {
|
|
"quote": {
|
|
"$ref": "common.schema.json#/$defs/quote"
|
|
},
|
|
"context": {
|
|
"$ref": "common.schema.json#/$defs/cellContext"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"if": {
|
|
"required": [
|
|
"span"
|
|
]
|
|
},
|
|
"then": {
|
|
"required": [
|
|
"quote"
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|