Skip to content
Snippets Groups Projects
schema.json 2.54 KiB
Newer Older
{
	"$schema": "http://json-schema.org/schema#",
	"definitions": {
		"word": {
			"type":"object",
			"required": ["word"],
			"properties": {
				"word": {
					"type": "string"
				},
				"description": {
					"type": "string"
Ben Eltschig's avatar
Ben Eltschig committed
				},
				"synonyms": {
					"type": "array",
					"items": {
						"type": "string"
					}
				}
			},
			"additionalProperties": false
		},
		"topic": {
			"type": "object",
			"properties": {
				"name": {
					"type": "string"
				},
				"words": {
					"type": "array",
					"items": {"$ref":"#/definitions/word"}
				},
				"subtopics": {
					"type": "array",
					"items": {"$ref":"#/definitions/topic"}
				}
			},
			"additionalProperties": false
		},
		"module": {
			"type": "object",
			"required": ["name","words","defaultRelevance"],
			"properties": {
				"name": {
					"type": "string"
				},
				"defaultRelevance": {
					"type": "number",
					"description": "the default relevance for words in this module"
				},
				"words": {
					"type": "array",
					"items": {
						"anyOf": [
Ben Eltschig's avatar
Ben Eltschig committed
							{"$ref":"#/definitions/wordRef"},
							{"$ref":"#/definitions/wordRefs"}
						]
					},
					"description": "references to / definitions for all words in this module"
				}
			},
			"additionalProperties": false
		},
		"wordRef": {
Ben Eltschig's avatar
Ben Eltschig committed
			"description": "a definition or reference to a word as it appears in modules",
			"type":"object",
			"required": ["word"],
			"properties": {
				"word": {
					"type": "string"
				},
				"description": {
					"type": "string"
				},
				"synonyms": {
					"type": "array",
					"items": {
						"type": "string"
					}
				},
				"relevance": {
					"type": "number"
				}
			},
			"additionalProperties": false
		},
		"wordRefs": {
			"description": "a reference to a bunch of already-defined words",
			"required": ["from", "words"],
				"from": {
				"words": {
					"type": "array",
Ben Eltschig's avatar
Ben Eltschig committed
					"items": {
						"anyOf": [
							{"type": "string"},
							{"$ref":"#/definitions/wordRef"}
						]
					}
				"relevance": {
					"type": "number"
				},
				"description": {
					"type": "string"
				}
			},
			"additionalProperties": false
		}
	},
	"type": "object",
		"macros": {
			"type": "object",
			"additionalProperties": {
				"type": "string"
			}
		},
			"items": {"$ref":"#/definitions/topic"}
		},
		"modules": {
			"type": "array",
			"items": {"$ref": "#/definitions/module"}
		}
	},
	"additionalProperties": false