Updated
May 6, 2019, 6:25:22 AM

{
    "$schema": "http://json-schema.org/schema#",
    "additionalProperties": false,
    "defs": {
        "non-empty-string": {
            "minLength": 1,
            "type": "string"
        }
    },
    "properties": {
        "authors": {
            "items": {
                "type": "string"
            },
            "type": "array",
            "uniqueItems": true
        },
        "label": {
            "type": "string"
        },
        "language": {
            "default": "EN",
            "oneOf": [
                {
                    "pattern": "^[A-Z]{2}$",
                    "type": "string"
                }
            ],
            "type": "string"
        },
        "measures": {
            "items": {
                "properties": {
                    "category": {
                        "type": "string"
                    },
                    "code": {
                        "type": "string"
                    },
                    "label": {
                        "type": "string"
                    },
                    "uuid": {
                        "pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "required": [
                "uuid",
                "label",
                "category",
                "code"
            ],
            "type": "array",
            "uniqueItems": true
        },
        "refs": {
            "items": {
                "$ref": "#/defs/non-empty-string"
            },
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
        },
        "uuid": {
            "pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
            "type": "string"
        },
        "version": {
            "type": "string"
        }
    },
    "required": [
        "uuid",
        "label",
        "version",
        "measures"
    ],
    "title": "Validator for referentials used in MONARC",
    "type": "object"
}