{
    "$schema": "http://json-schema.org/draft-06/schema#",
    "definitions": {
        "courseCodeString": {
            "type": "string",
            "pattern": "^[A-Z]{4} [0-9]{3,4}$"
        },
        "arrayOfCourseCodeOrLists": {
            "type": "array",
            "items": {
                "type": "array",
                "minItems": 1,
                "items": {
                    "$ref": "#/definitions/courseCodeString"
                }
            }
        },
        "alphaNumPunctString": {
            "type": "string",
            "pattern": "^[\\w\u00f1\u00fc\u00fa\u00e1\u00e0\u00ed\u00ce\u00f6\u00f3\u00f2\u00eb\u00e9\u00c9\u00e8\u00c8 ,'\u201c\u201d\u2018\u2019\"--\u00ad\u2010\u2011\u2012\u2013\u2014/.:;?\u00a7()\\[\\]]+$"
        },
        "posNumRoundedToHundredths": {
            "type": "string",
            "pattern": "^[0-9](\\.[0-9]{1,2})?$"
        }
    },
    "title": "Course Info Schema",
    "description": "A set of courses offered at concordia with information about each one.",
    "type": "array",
    "_uniqueItems": true,
    "items": {
        "type": "object",
        "properties": {
            "code": {
                "$ref": "#/definitions/courseCodeString"
            },
            "name": {
                "$ref": "#/definitions/alphaNumPunctString"
            },
            "credits": {
                "$ref": "#/definitions/posNumRoundedToHundredths"
            },
            "description": {
                "$ref": "#/definitions/alphaNumPunctString"
            },
            "requirements": {
                "type": "object",
                "properties": {
                    "prereqs": {
                        "$ref": "#/definitions/arrayOfCourseCodeOrLists"
                    },
                    "coreqs": {
                        "$ref": "#/definitions/arrayOfCourseCodeOrLists"
                    }
                }
            },
            "lectureHours": {
                "type": "string"
            },
            "tutorialHours": {
                "type": "string"
            },
            "labHours": {
                "type": "string"
            },
            "note": {
                "type": "string"
            }
        },
        "required": [
            "code",
            "name",
            "credits",
            "description",
            "requirements"
        ],
        "additionalProperties": false
    }
}