{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://zeropress.dev/schemas/preview-data.v0.4.schema.json",
  "title": "ZeroPress Theme Preview Data v0.4",
  "type": "object",
  "additionalProperties": false,
  "required": ["version", "generator", "generated_at", "site", "content"],
  "properties": {
    "version": {
      "const": "0.4"
    },
    "generator": {
      "type": "string",
      "minLength": 1
    },
    "generated_at": {
      "type": "string",
      "format": "date-time"
    },
    "site": {
      "$ref": "#/$defs/site"
    },
    "content": {
      "$ref": "#/$defs/content"
    }
  },
  "$defs": {
    "site": {
      "type": "object",
      "required": [
        "title",
        "description",
        "url",
        "locale",
        "postsPerPage",
        "dateFormat",
        "timeFormat",
        "timezone",
        "disallowComments"
      ],
      "properties": {
        "title": { "type": "string", "minLength": 1 },
        "description": { "type": "string" },
        "url": {
          "type": "string",
          "anyOf": [
            { "const": "" },
            { "format": "uri" }
          ]
        },
        "mediaBaseUrl": { "type": "string", "format": "uri" },
        "locale": { "type": "string", "minLength": 2 },
        "postsPerPage": { "type": "integer", "minimum": 1 },
        "dateFormat": { "type": "string", "minLength": 1 },
        "timeFormat": { "type": "string" },
        "timezone": { "type": "string", "minLength": 1 },
        "disallowComments": { "type": "boolean" },
        "logo": { "type": "string", "format": "uri" },
        "social": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      },
      "additionalProperties": true
    },
    "previewPost": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "public_id",
        "title",
        "slug",
        "html",
        "excerpt",
        "published_at_iso",
        "updated_at_iso",
        "author_name",
        "status",
        "allow_comments",
        "category_slugs",
        "tag_slugs"
      ],
      "properties": {
        "id": { "type": "string", "minLength": 1 },
        "public_id": { "type": "integer", "minimum": 1 },
        "title": { "type": "string", "minLength": 1 },
        "slug": { "type": "string", "minLength": 1 },
        "html": { "type": "string" },
        "excerpt": { "type": "string" },
        "published_at_iso": { "type": "string", "format": "date-time" },
        "updated_at_iso": { "type": "string", "format": "date-time" },
        "author_name": { "type": "string", "minLength": 1 },
        "author_avatar": { "type": "string", "minLength": 1 },
        "featured_image": { "type": "string", "minLength": 1 },
        "status": {
          "type": "string",
          "enum": ["published", "draft"]
        },
        "allow_comments": { "type": "boolean" },
        "category_slugs": {
          "type": "array",
          "items": { "type": "string", "minLength": 1 }
        },
        "tag_slugs": {
          "type": "array",
          "items": { "type": "string", "minLength": 1 }
        }
      }
    },
    "previewPage": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "title", "slug", "html", "status"],
      "properties": {
        "id": { "type": "string", "minLength": 1 },
        "title": { "type": "string", "minLength": 1 },
        "slug": { "type": "string", "minLength": 1 },
        "html": { "type": "string" },
        "excerpt": { "type": "string" },
        "featured_image": { "type": "string", "minLength": 1 },
        "status": {
          "type": "string",
          "enum": ["published", "draft"]
        }
      }
    },
    "previewCategory": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "name", "slug"],
      "properties": {
        "id": { "type": "string", "minLength": 1 },
        "name": { "type": "string", "minLength": 1 },
        "slug": { "type": "string", "minLength": 1 },
        "description": { "type": "string" }
      }
    },
    "previewTag": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "name", "slug"],
      "properties": {
        "id": { "type": "string", "minLength": 1 },
        "name": { "type": "string", "minLength": 1 },
        "slug": { "type": "string", "minLength": 1 },
        "description": { "type": "string" }
      }
    },
    "content": {
      "type": "object",
      "additionalProperties": false,
      "required": ["posts", "pages", "categories", "tags"],
      "properties": {
        "posts": {
          "type": "array",
          "items": { "$ref": "#/$defs/previewPost" }
        },
        "pages": {
          "type": "array",
          "items": { "$ref": "#/$defs/previewPage" }
        },
        "categories": {
          "type": "array",
          "items": { "$ref": "#/$defs/previewCategory" }
        },
        "tags": {
          "type": "array",
          "items": { "$ref": "#/$defs/previewTag" }
        }
      }
    }
  }
}
