{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://open-interop.lab.abilian.com/cloud/s4/manifest-entry-0.1.schema.json",
  "title": "S4 export manifest entry",
  "description": "One object of an export manifest (S4 test scenarios, annex A: https://open-interop.lab.abilian.com/cloud/s4/scenarios/). A manifest is a JSON Lines file with one entry per object. Every field is present; a field the object does not carry is null.",
  "type": "object",
  "required": [
    "key", "size", "checksum", "last_modified", "etag",
    "content_type", "content_encoding", "content_language", "content_disposition", "cache_control", "expires",
    "user_metadata", "tags"
  ],
  "additionalProperties": false,
  "properties": {
    "key": {
      "description": "At most 1,024 UTF-8 bytes, which tools must check besides this character limit.",
      "type": "string", "minLength": 1, "maxLength": 1024
    },
    "size": {"type": "integer", "minimum": 0},
    "checksum": {
      "type": "object",
      "required": ["algorithm", "value"],
      "additionalProperties": false,
      "properties": {
        "algorithm": {"const": "sha256"},
        "value": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
      }
    },
    "last_modified": {
      "description": "Server-assigned date at the source; null in a reference manifest.",
      "type": ["string", "null"],
      "format": "date-time"
    },
    "etag": {
      "description": "Informative only; never an integrity proof.",
      "type": ["string", "null"]
    },
    "content_type": {"type": ["string", "null"]},
    "content_encoding": {"type": ["string", "null"]},
    "content_language": {"type": ["string", "null"]},
    "content_disposition": {"type": ["string", "null"]},
    "cache_control": {"type": ["string", "null"]},
    "expires": {"type": ["string", "null"], "format": "date-time"},
    "user_metadata": {
      "type": "object",
      "additionalProperties": {"type": "string"}
    },
    "tags": {
      "description": "Null when tags are claimed but the server does not implement tagging.",
      "type": ["object", "null"],
      "additionalProperties": {"type": "string"}
    }
  }
}
