Add initial JSON schema for nutriman data

master
kts of kettek 2017-02-22 00:21:07 -08:00
commit d90f80ce96
1 changed files with 125 additions and 0 deletions

125
schema.json 100644
View File

@ -0,0 +1,125 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"reference": {
"title": "Reference",
"description": "A reference",
"type": "object",
"properties": {
"id": {
"title": "Identifier",
"description": "The unique identifier for the reference",
"type": "string"
},
"name": {
"title": "Name",
"description": "The name of the reference",
"type": "string"
},
"source": {
"title": "Source",
"description": "The source of the reference, such as a URL",
"type": "string"
}
}
},
"mineral": {
"title": "Mineral",
"description": "A Mineral Entry for Nutriman",
"type": "object",
"properties": {
"name": {
"title": "Name",
"description": "Name of the mineral",
"type": "string"
},
"rda": {
"type": "object",
"title": "Allowance",
"properties": {
"amount": {
"title": "Amount",
"description": "The amount of the RDA",
"type": "string"
},
"ref": {
"title": "Reference",
"description": "The reference id of the allowance",
"type": "string"
}
}
}
},
"required": ["name", "rda"]
},
"vitamin": {
"title": "Vitamin",
"description": "A Vitamin Entry for Nutriman",
"type": "object",
"properties": {
"names": {
"title": "Names",
"description": "Names of the vitamin, first entry is the primary name",
"type": "array",
"items": {
"type": "string",
"title": "Name"
},
"uniqueItems": true,
"minItems": 1
},
"rda": {
"type": "object",
"title": "Allowance",
"properties": {
"amount": {
"title": "Amount",
"description": "The amount of the RDA",
"type": "string"
},
"ref": {
"title": "Reference",
"description": "The reference id of the allowance",
"type": "string"
}
}
}
},
"required": ["names", "rda"]
}
},
"title": "Nutritional Data Sheet",
"properties": {
"vitamins": {
"title": "Vitamins",
"description": "A list of all vitamins",
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/vitamin"
}
},
"minerals": {
"title": "Minerals",
"description": "A list of all minerals",
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/mineral"
}
},
"references": {
"title": "References",
"description": "An array of references for RDAs, UILs, and similar",
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/reference"
},
"required": ["id", "name", "source"]
}
}
}