{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://demodb.dev/ovdb/schemas/ovdb-server-draft-1.schema.json",
  "title": "OpenVaultDB server descriptor draft 1",
  "type": "object",
  "additionalProperties": false,
  "required": ["format", "id", "title", "description", "homepage", "apiUrl", "databases"],
  "properties": {
    "format": { "const": "ovdb-server/draft-1" },
    "id": { "$ref": "#/$defs/httpsUrl" },
    "title": { "type": "string", "minLength": 1 },
    "description": { "type": "string", "minLength": 1 },
    "homepage": { "$ref": "#/$defs/httpsUrl" },
    "apiUrl": { "$ref": "#/$defs/httpsUrl" },
    "databases": {
      "type": "array", "minItems": 1,
      "items": {
        "type": "object", "additionalProperties": false,
        "required": ["id", "localId", "serverDbBaseUrl", "manifestUrl", "apiUrl"],
        "properties": {
          "id": { "$ref": "#/$defs/httpsUrl" },
          "localId": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,39}$" },
          "serverDbBaseUrl": { "$ref": "#/$defs/httpsUrl" },
          "manifestUrl": { "$ref": "#/$defs/httpsUrl" },
          "apiUrl": { "$ref": "#/$defs/httpsUrl" }
        }
      }
    }
  },
  "$defs": { "httpsUrl": { "type": "string", "pattern": "^https://[^\\s]+$" } }
}
