{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Dataset definition",
    "description": "Definition of cDAL dataset",
    "type": "object",
    "properties": {
        "datasetName": {
            "description": "Name of dataset",
            "type": "string"
        },
        "models": {
            "type": "array",
            "minItems": 1,
            "_uniqueItems": true,
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "typeName": {
                        "type": "string"
                    },
                    "tableName": {
                        "type": "string"
                    },
                    "fields": {
                        "type": "array",
                        "minItems": 1,
                        "_uniqueItems": true,
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "type": {
                                    "type": "string"
                                }
                            },
                            "required": [
                                "name",
                                "type"
                            ]
                        }
                    }
                },
                "required": [
                    "name",
                    "fields"
                ]
            }
        }
    },
    "required": [
        "datasetName",
        "models"
    ]
}