{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:folio:1:manifest",
  "title": "manifest.json",
  "description": "What the archive is. Required in every .folio file.",
  "type": "object",
  "required": [
    "format",
    "formatVersion",
    "scope"
  ],
  "properties": {
    "format": {
      "const": "folio"
    },
    "formatVersion": {
      "const": 1,
      "description": "This schema is version 1. Apps refuse a version above the one they know."
    },
    "scope": {
      "enum": [
        "full",
        "selection"
      ],
      "description": "full: the whole cookbook and settings. selection: chosen recipes only."
    },
    "createdAt": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$",
      "description": "ISO 8601 in UTC with a Z, seconds required, fractions of a second optional (up to 9 digits): 2026-11-08T12:00:00Z."
    },
    "app": {
      "type": "object",
      "required": [
        "platform",
        "version"
      ],
      "properties": {
        "platform": {
          "type": "string",
          "description": "ios, android, or the name of the tool that wrote the file."
        },
        "version": {
          "type": "string"
        }
      }
    },
    "counts": {
      "type": "object",
      "required": [
        "recipes",
        "photos"
      ],
      "properties": {
        "recipes": {
          "type": "integer",
          "minimum": 0
        },
        "photos": {
          "type": "integer",
          "minimum": 0
        },
        "groceries": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "corrections": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        }
      },
      "description": "Informational: the import preview counts what is really in the file."
    }
  }
}
