{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://meshcast.ca/profiles/schema.json",
  "title": "Meshcast MeshCore profile",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "protocol",
    "public_key",
    "display_name",
    "bio",
    "avatar_url",
    "links",
    "verification",
    "updated_at"
  ],
  "properties": {
    "schema_version": {
      "const": 1
    },
    "protocol": {
      "const": "meshcore"
    },
    "public_key": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "display_name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
    },
    "bio": {
      "type": "string",
      "maxLength": 240
    },
    "avatar_url": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string",
          "format": "uri",
          "pattern": "^https://",
          "maxLength": 1000
        }
      ]
    },
    "links": {
      "type": "array",
      "maxItems": 6,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "label",
          "url"
        ],
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253
          },
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://",
            "maxLength": 1000
          }
        }
      }
    },
    "verification": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status",
        "note"
      ],
      "properties": {
        "status": {
          "enum": [
            "unverified",
            "site-maintained"
          ]
        },
        "note": {
          "type": "string",
          "maxLength": 500
        }
      }
    },
    "updated_at": {
      "type": "string",
      "format": "date"
    }
  }
}
