{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "BOLTS part schema",
    "description": "Configuration for the BOLTS importer to import part information",
    "bolts": {
        "type": "object",
        "description": "A dictionary of BOLTS data",
        "patternProperties": {
            "^([a-zA-Z][0-9a-zA-Z]*)$": {
                "oneOf": [
                    {
                        "$ref": "#/standard"
                    },
                    {
                        "$ref": "#/name"
                    }
                ]
            }
        }
    },
    "standard": {
        "type": "object",
        "description": "The information necessary for BOLTS to look up information about a standard",
        "properties": {
            "standard": {
                "type": "string",
                "pattern": "^[a-zA-Z0-9_]*$",
                "description": "The BOLTS id of the standard"
            },
            "free": {
                "type": "object",
                "description": "Values for the free parameters"
            },
            "quantity": {
                "type": "number",
                "description": "Number of instances of this object",
                "default": 1
            },
            "optional": {
                "type": "boolean",
                "description": "If this object is strictly required",
                "default": false
            }
        },
        "required": [
            "standard"
        ],
        "additionalProperties": false
    },
    "name": {
        "type": "object",
        "description": "The information necessary for BOLTS to look up information about a name",
        "properties": {
            "name": {
                "type": "string",
                "pattern": "^[a-zA-Z0-9_]*$",
                "description": "The BOLTS id of the name"
            },
            "free": {
                "type": "object",
                "description": "Values for the free parameters"
            },
            "quantity": {
                "type": "number",
                "description": "Number of instances of this object",
                "default": 1
            },
            "optional": {
                "type": "boolean",
                "description": "If this object is strictly required",
                "default": false
            }
        },
        "required": [
            "name"
        ],
        "additionalProperties": false
    },
    "properties": {
        "bolts": {
            "$ref": "#/bolts"
        },
        "standard": {
            "$ref": "#/standard"
        },
        "name": {
            "$ref": "#/name"
        }
    },
    "required": [
        "bolts",
        "standard",
        "name"
    ]
}