I try to write a json schema for my data. The data looks that way:
{ "gold": [ { "id": "goldOne", "name": "firstGold", "title": "Gold 1 earned" }, { "id": "goldTwo", "name": "secondGold", "title": "Gold 2 earned" } ], "silver": [ { "id": "silberOne", "name": "firstSilver", "title": "Silver!" } ], "bronze": [ { "id": "bronzeOne", "name": "firstBronze", "title": "Bronze!" } ] } I already created the schema for the "gold"-array:
{ "$schema": "http://json-schema.org/draft-04/schema#", "title" : "trophy descriptions", "type": "object", "properties": { gold: { "description": "gold trophies", "type":"array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "unique identifier" }, "name": { "type": "string", "description": "label of trophy" }, "title": { "type": "string", "description": "description of trophy" } } } } } } Because the "silver" and "bronze" -arrays contain elements of the exact same type as "gold" I wonder if I have to write down the same stuff three times or if I can refer to a single description?