{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "title": "vendors.json",
 "type": "array",
 "items": {
  "type": "object",
  "additionalProperties": false,
  "required": [
   "slug",
   "name",
   "product",
   "homepage",
   "as_of",
   "categories",
   "deployment",
   "licence_model",
   "ownership",
   "capabilities",
   "line_items"
  ],
  "properties": {
   "slug": {
    "type": "string"
   },
   "name": {
    "type": "string"
   },
   "product": {
    "type": [
     "string",
     "null"
    ]
   },
   "homepage": {
    "type": [
     "string",
     "null"
    ]
   },
   "as_of": {
    "type": "string",
    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
   },
   "categories": {
    "type": "array",
    "items": {
     "type": "string"
    }
   },
   "deployment": {
    "type": "array",
    "items": {
     "type": "string"
    }
   },
   "licence_model": {
    "enum": [
     "proprietary",
     "open-core",
     "open-source",
     "source-available",
     "mixed"
    ]
   },
   "ownership": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "status",
     "owner",
     "announced",
     "closed",
     "src"
    ],
    "properties": {
     "status": {
      "enum": [
       "public",
       "private",
       "acquired"
      ]
     },
     "owner": {
      "type": [
       "string",
       "null"
      ]
     },
     "announced": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}(-\\d{2}){1,2}$"
     },
     "closed": {
      "type": [
       "string",
       "null"
      ],
      "pattern": "^\\d{4}(-\\d{2}){1,2}$"
     },
     "src": {
      "type": "array",
      "items": {
       "type": "string"
      }
     }
    }
   },
   "capabilities": {
    "type": "object",
    "additionalProperties": {
     "type": "object",
     "additionalProperties": false,
     "required": [
      "level",
      "src"
     ],
     "properties": {
      "level": {
       "enum": [
        "yes",
        "partial",
        "no",
        "addon"
       ]
      },
      "src": {
       "type": "array",
       "items": {
        "type": "string"
       }
      }
     }
    }
   },
   "line_items": {
    "type": "array",
    "items": {
     "type": "object",
     "additionalProperties": false,
     "required": [
      "sku",
      "unit",
      "price_usd",
      "commitment",
      "src"
     ],
     "properties": {
      "sku": {
       "type": "string"
      },
      "unit": {
       "type": "string"
      },
      "price_usd": {
       "type": [
        "number",
        "null"
       ],
       "minimum": 0
      },
      "commitment": {
       "type": "string"
      },
      "src": {
       "type": "array",
       "items": {
        "type": "string"
       }
      }
     }
    }
   }
  }
 }
}
