1.json 1.87 KB
Newer Older
André Anjos's avatar
André Anjos committed
1 2 3 4 5 6 7 8 9 10 11 12
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Common definitions for BEAT",
  "description": "This schema defines common properties of a BEAT objects",

  "definitions": {

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

13
    "uint_basetype": {
André Anjos's avatar
André Anjos committed
14 15 16 17 18
      "type": "string",
      "enum": [
        "uint8",
        "uint16",
        "uint32",
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
        "uint64"
      ]
    },

    "int_basetype": {
      "type": "string",
      "enum": [
        "int8",
        "int16",
        "int32",
        "int64"
      ]
    },

    "float_basetype": {
      "type": "string",
      "enum": [
André Anjos's avatar
André Anjos committed
36
        "float32",
37
        "float64"
André Anjos's avatar
André Anjos committed
38 39 40
      ]
    },

41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
    "basetype": {
            "anyOf": [
                    { "$ref": "#/definitions/uint_basetype" },
                    { "$ref": "#/definitions/int_basetype" },
                    { "$ref": "#/definitions/float_basetype" },
                    {
                            "type": "string",
                            "enum": [
                                    "bool",
                                    "string"
                            ]
                    }
            ]
    },

André Anjos's avatar
André Anjos committed
56 57 58 59 60 61 62 63 64
    "value": {
      "oneOf": [
        { "type": "string" },
        { "type": "number" },
        { "type": "boolean" }
      ]
    },

    "description": {
65
      "type": "string"
André Anjos's avatar
André Anjos committed
66 67 68 69 70 71 72 73
    },

    "language": {

      "type": "string",
      "enum": [
        "unknown",
        "python",
74
        "cxx",
André Anjos's avatar
André Anjos committed
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
        "matlab",
        "r"
      ]

    },

    "uses": {
      "type": "object",
      "patternProperties": {
        "^[a-zA-Z_][a-zA-Z0-9_]*$": {
          "$ref": "#/definitions/reference"
        },
        "uniqueItems": true,
        "additionalProperties": false
      }
    },

    "version": {
      "type": "number",
      "multipleOf": 1.0,
      "minimum": 1.0
    }

  }

}