{
  "id": "site.json",
  "$schema": "http://json-schema.org/draft-04/schema",
  "title": "Site",
  "description": "Grid site",
  "type": "object",
  "properties": {
    "id": {
      "$ref": "base.json#/definitions/uuid"
    },
    "name": {
      "type": "string",
      "description": "User-readable name of the website"
    },
    "repo": {
      "type": "string",
      "description": "GitHub repository path for website sources",
      "$ref": "base.json#/definitions/site"
    },
    "domain": {
      "example": "blog.thegrid.io",
      "description": "Custom domain for the website, if any",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "string",
          "format": "hostname"
        }
      ]
    },
    "path": {
      "type": [
        "string",
        "null"
      ],
      "example": "/news",
      "description": "Subdirectory path for the website, if any"
    },
    "config": {
      "$ref": "siteconfig.json"
    },
    "owner": {
      "$ref": "base.json#/definitions/uuid"
    },
    "url": {
      "description": "Full site URL based on domain and path",
      "$ref": "base.json#/definitions/url"
    },
    "favlogo": {
      "description": "URL of the website favlogo",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "base.json#/definitions/url"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "string",
          "format": "date-time"
        }
      ]
    }
  },
  "required": [
    "name",
    "repo"
  ],
  "anyOf": [
    {
      "required": [
        "domain"
      ]
    },
    {
      "required": [
        "path"
      ]
    }
  ]
}