{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "JSON Schema for NVD CVE Applicability Statement CPE Match API version 2.0",
	"$id": "https://csrc.nist.gov/schema/nvd/api/2.0/cpematch_api_json_2.0.schema",
    "definitions": {
		"def_matchstring": {
		  "type": "object",
		  "properties": {
			"matchString": {"$ref": "#/definitions/def_match_data"}
		  },
		  "required": ["matchString"],
		  "additionalProperties": false
		},
		"def_cpe_name": {
		  "type": "object",
		  "properties": {
			"cpeName": {"type": "string"},
			"cpeNameId": {"type": "string", "format": "uuid"}
		  },
		  "required": ["cpeName", "cpeNameId"],
		  "additionalProperties": false
		},
		"def_match_data": {
		  "description": "CPE match string or range",
		  "type": "object",
		  "properties": {
			"criteria": {"type": "string"},
			"matchCriteriaId": {"type": "string", "format": "uuid"},
			"versionStartExcluding": {"type": "string"},
			"versionStartIncluding": {"type": "string"},
			"versionEndExcluding": {"type": "string"},
			"versionEndIncluding": {"type": "string"},
			"created": {"type": "string", "format": "date-time"},
			"lastModified": {"type": "string", "format": "date-time"},
			"cpeLastModified": {"type": "string", "format": "date-time"},
			"status": {"type": "string"},
			"matches": {
			  "type": "array",
			  "items": {"$ref": "#/definitions/def_cpe_name"}
			}
		  },
		  "required": ["criteria", "matchCriteriaId", "lastModified", "created", "status"],
		  "additionalProperties": false
		}
	},
    "type": "object",
    "properties": {
		"resultsPerPage": {"type": "integer"},
		"startIndex": {"type": "integer"},
		"totalResults": {"type": "integer"},
		"format": {"type": "string"},
		"version": {"type": "string"},
		"timestamp": {"type": "string", "format": "date-time"},
        "matchStrings": {
            "description": "Array of CPE match strings",
            "type": "array",
            "items": {"$ref": "#/definitions/def_matchstring"}
        }
    },
    "required": [
		"resultsPerPage",
		"startIndex",
		"totalResults",
		"format",
		"version",
		"timestamp",
        "matchStrings"
    ],
	"additionalProperties": false
}