zarrs_conventions_thumbnails 0.1.0

Thumbnails zarr-convention for the zarrs ecosystem
Documentation
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "thumbnails Convention",
  "description": "Schema for thumbnails Zarr convention, supporting both key-prefixed and nested namespace patterns",
  "type": "object",
  "properties": {
    "zarr_format": {
      "type": "integer",
      "description": "Zarr format version"
    },
    "node_type": {
      "type": "string",
      "enum": ["array", "group"],
      "description": "Type of Zarr node"
    },
    "attributes": {
      "type": "object",
      "description": "Zarr attributes containing convention metadata and properties",
      "properties": {
        "zarr_conventions": {
          "type": "array",
          "description": "Array of convention metadata objects",
          "contains": {
            "$ref": "#/$defs/conventionMetadata"
          }
        },
        "thumbnails": {
          "type": "array",
          "description": "Array of thumbnail objects",
          "items": {
            "$ref": "#/$defs/thumbnail"
          }
        }
      },
      "required": ["zarr_conventions", "thumbnails"]
    }
  },
  "required": ["zarr_format", "node_type", "attributes"],
  "additionalProperties": true,
  "$defs": {
    "conventionMetadata": {
      "type": "object",
      "description": "thumbnails convention metadata object for use in zarr_conventions array",
      "properties": {
        "schema_url": {
          "type": "string",
          "const": "https://raw.githubusercontent.com/zarr-conventions/thumbnails/refs/tags/v1/schema.json",
          "description": "URL to the JSON Schema definition for this convention"
        },
        "spec_url": {
          "type": "string",
          "const": "https://github.com/zarr-conventions/thumbnails/blob/v1/README.md",
          "description": "URL to the full specification document"
        },
        "uuid": {
          "type": "string",
          "const": "49326c01-1180-4743-b15f-f7157038a6ab",
          "description": "UUID that permanently identifies this convention"
        },
        "name": {
          "type": "string",
          "description": "Human-readable name of the convention. Should be 'thumbnails:' for key-prefixed pattern or 'thumbnails' for nested pattern"
        },
        "description": {
          "type": "string",
          "const": "thumbnails convention for demonstrating Zarr convention metadata structure",
          "description": "Brief description of the convention's purpose and usage"
        }
      },
      "anyOf": [
        {
          "required": ["schema_url"]
        },
        {
          "required": ["spec_url"]
        },
        {
          "required": ["uuid"]
        }
      ],
      "additionalProperties": false
    },
    "hasPath": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string"
        }
      },
      "required": ["path"]
    },
    "hasUrl": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": ["url"]
    },
    "thumbnailDetails": {
      "type": "object",
      "description": "Thumbnail details.",
      "properties": {
        "width": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Width of the thumbnail in pixels."
        },
        "height": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Height of the thumbnail in pixels."
        },
        "media_type": {
          "type": "string",
          "description": "Media type (formerly MIME type) of the thumbnail, e.g., 'image/jpeg'."
        },
        "description": {
          "type": "string",
          "description": "Free-text description of this thumbnail's context; could be used as alt text."
        },
        "attributes": {
          "type": "object",
          "description": "Unstructured arbitrary metadata about the thumbnail; could store information about how it was generated or how it represents the zarr node.",
          "additionalProperties": true
        }
      },
      "required": ["width", "height", "media_type"]
    },
    "thumbnail": {
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/thumbnailDetails"
        },
        {
          "type": "object",
          "oneOf": [
            {
              "$ref": "#/$defs/hasPath"
            },
            {
              "$ref": "#/$defs/hasUrl"
            }
          ]
        }
      ]
    }
  }
}