{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openbrandexchange.com/schemas/v0.1/Rendition.json",
  "type": "object",
  "title": "Rendition",
  "description": "One downloadable form of an asset. original = uploaded bytes, unmodified; web = longest side <= 2000 px JPEG; square = web centred on a white square canvas; thumb = longest side <= 600 px JPEG.",
  "properties": {
    "name": {
      "$ref": "Common.json#/$defs/RenditionName"
    },
    "url": {
      "$ref": "Common.json#/$defs/Url",
      "description": "Download URL. Either short-lived signed (usable without Authorization until url_expires_at) or requiring the Bearer token. Never a permanent public URL. Clients MUST treat it as opaque."
    },
    "url_expires_at": {
      "anyOf": [
        {
          "$ref": "Common.json#/$defs/DateTime"
        },
        {
          "type": "null"
        }
      ]
    },
    "content_type": {
      "type": "string",
      "description": "Media type. 'original' keeps the uploaded type; web/square/thumb are image/jpeg.",
      "examples": [
        "image/jpeg"
      ]
    },
    "width": {
      "type": "integer",
      "minimum": 1
    },
    "height": {
      "type": "integer",
      "minimum": 1
    },
    "bytes": {
      "type": "integer",
      "minimum": 1
    },
    "sha256": {
      "$ref": "Common.json#/$defs/Sha256"
    }
  },
  "required": [
    "name",
    "url",
    "content_type",
    "width",
    "height",
    "bytes",
    "sha256"
  ],
  "additionalProperties": false,
  "patternProperties": {
    "^x-[a-z0-9]+-[a-z0-9_-]+$": true
  }
}
