2.json 2.18 KB
Newer Older
Samuel GAIST's avatar
Samuel GAIST committed
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Database descriptor v2",
  "description": "This schema defines the properties of a version 2 BEAT database",

  "type": "object",

  "properties": {

    "root_folder": {
      "type": "string",
      "pattern": "^((file://)?(/[^/]+)+|nfs://[a-z0-9._-]+:(/[^/]+)+)$"
    },

    "protocols": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": { "$ref": "#/definitions/protocol" }
    },

    "description": { "$ref": "../common/1.json#/definitions/description" },

    "schema_version": { "const": 2 }

  },

  "required": [
    "root_folder",
    "protocols",
    "schema_version"
  ],

  "additionalProperties": false,

  "definitions": {

    "template_identifier": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9_-]+/[0-9]+$"
    },

    "protocol": {
      "type": "object",
      "properties": {
        "name": { "$ref": "#/definitions/protocol_name" },
        "template": { "$ref": "#/definitions/template_identifier" },
        "views": { "$ref": "#/definitions/views" }
      },
      "required": ["name", "views", "template"],
      "additionalProperties": false
    },

    "protocol_name": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9_][\\.a-zA-Z0-9_-]*$"
    },

    "view_name": {
      "type": "string",
      "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$"
    },

    "views": {
      "type": "object",
      "minProperties": 1,
      "uniqueItems": true,
      "patternProperties": {
        "^[a-zA-Z_][a-zA-Z0-9_]*$": { "$ref": "#/definitions/view" }
      }
    },

    "view": {
      "type": "object",
      "properties": {
        "view": { "$ref": "#definitions/view_name" },
        "parameters": { "$ref": "#/definitions/parameters" }
      },
      "additionalProperties": false
    },

    "parameters": {
      "type": "object",
      "patternProperties": {
        "^[a-zA-Z_][a-zA-Z0-9_-]*$": {
          "$ref": "#/definitions/parameter_value"
        }
      }
    },

    "parameter_value": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        }
      ]
    }

  }

}