definitions.json 2.07 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "definitions.json",
  "title": "REX-DRI sub-entity definition",
  "description": "Schema to hold all the main definitions of JSON schemas from the REX-DRI project",
  "definitions": {
    "useful-links": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "url": {
            "description": "The unique identifier for a product",
            "type": "string",
            "format": "uri",
            "maxLength": 500
          },
          "description": {
            "description": "Name of the product",
            "type": "string",
            "maxLength": 500
          }
        },
        "required": [
          "url",
          "description"
        ],
        "additionalProperties": false
      }
    },
    "photos": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200
          },
          "licence": {
            "type": "string",
            "maxLength": 500
          },
          "url": {
            "description": "The unique identifier for a product",
            "type": "string",
            "format": "uri",
            "pattern": "^.*\\.(svg|png|jpg|jpeg)$",
            "maxLength": 500
          },
          "description": {
            "description": "Short description of the picture",
            "type": "string",
            "maxLength": 500
          }
        },
        "required": [
          "url",
          "title"
        ],
        "additionalProperties": false
      }
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
    },
    "palette": {
      "type": "object",
      "properties": {
        "primary": {
          "$ref": "definitions.json#/definitions/hex-color"
        },
        "secondary": {
          "$ref": "definitions.json#/definitions/hex-color"
        }
      },
      "required": [
        "primary",
        "secondary"
      ],
      "additionalProperties": false
    },
    "hex-color": {
      "pattern": "^#[0-9a-f]{6}$",
      "type": "string"
83 84 85
    }
  }
}