{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.peri.com/schemas/rich-results/event.schema.json",
  "title": "Event rich-results contract",
  "description": "Structure guaranteed for a single schema.org Event node.",
  "type": "object",
  "properties": {
    "@type": { "const": "Event" },
    "@id": { "type": "string", "minLength": 1 },
    "mainEntityOfPage": {
      "type": "object",
      "properties": { "@id": { "type": "string", "minLength": 1 } },
      "required": ["@id"],
      "additionalProperties": false
    },
    "name": { "type": "string", "minLength": 1 },
    "eventAttendanceMode": {
      "enum": [
        "https://schema.org/OnlineEventAttendanceMode",
        "https://schema.org/OfflineEventAttendanceMode"
      ]
    },
    "location": {
      "type": "object",
      "properties": {
        "@type": { "const": "Place" },
        "name": { "type": "string" },
        "address": {
          "type": "object",
          "properties": {
            "@type": { "const": "PostalAddress" },
            "streetAddress": { "type": "string" },
            "addressLocality": { "type": "string" },
            "postalCode": { "type": "string" },
            "addressCountry": { "type": "string", "minLength": 1 }
          },
          "required": ["@type", "addressCountry"],
          "additionalProperties": false
        }
      },
      "required": ["@type", "address"],
      "additionalProperties": false
    },
    "url": { "type": "string", "minLength": 1 },
    "startDate": { "type": "string", "minLength": 1 },
    "endDate": { "type": "string", "minLength": 1 },
    "organizer": {
      "type": "object",
      "properties": { "@id": { "type": "string", "minLength": 1 } },
      "required": ["@id"],
      "additionalProperties": false
    },
    "description": { "type": "string" }
  },
  "required": ["@type", "@id", "mainEntityOfPage", "name", "eventAttendanceMode", "startDate", "organizer", "description"],
  "additionalProperties": false
}
