{
    "id": "http://n7space.com/asn1-lib-module-schema.json",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "ASN.1 Types Library Module Metadata schema",
    "definitions": {
        "nonEmptyString": {
            "type": "string",
            "minLength": 1
        },
        "fileList": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/nonEmptyString"
            }
        },
        "externalReference": {
            "type": "object",
            "properties": {
                "module": {
                    "$ref": "#/definitions/nonEmptyString"
                },
                "submodule": {
                    "$ref": "#/definitions/nonEmptyString"
                },
                "element": {
                    "$ref": "#/definitions/nonEmptyString"
                }
            },
            "required": [
                "submodule",
                "element"
            ],
            "additionalProperties": false
        },
        "referenceList": {
            "type": "array",
            "items": {
                "oneOf": [
                    {
                        "$ref": "#/definitions/nonEmptyString"
                    },
                    {
                        "$ref": "#/definitions/externalReference"
                    }
                ]
            }
        }
    },
    "type": "object",
    "properties": {
        "name": {
            "$ref": "#/definitions/nonEmptyString"
        },
        "description": {
            "type": "string"
        },
        "submodules": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/nonEmptyString"
                    },
                    "description": {
                        "type": "string"
                    },
                    "elements": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "$ref": "#/definitions/nonEmptyString"
                                },
                                "description": {
                                    "type": "string"
                                },
                                "asn1Files": {
                                    "$ref": "#/definitions/fileList"
                                },
                                "additionalFiles": {
                                    "$ref": "#/definitions/fileList"
                                },
                                "conflicts": {
                                    "$ref": "#/definitions/referenceList"
                                },
                                "requires": {
                                    "$ref": "#/definitions/referenceList"
                                }
                            },
                            "required": [
                                "name"
                            ],
                            "additionalProperties": false
                        }
                    }
                },
                "required": [
                    "name"
                ],
                "additionalProperties": false
            }
        }
    },
    "required": [
        "name"
    ],
    "additionalProperties": false
}