{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://github.com/api-evangelist/ubuntu/blob/main/json-schema/ubuntu-snap-schema.json",
  "title": "Snap Package",
  "description": "Schema for a Snap package in the Canonical Snap Store.",
  "type": "object",
  "properties": {
    "snap-id": {
      "type": "string",
      "description": "Unique snap identifier."
    },
    "name": {
      "type": "string",
      "description": "Snap package name (kebab-case)."
    },
    "title": {
      "type": "string",
      "description": "Display title of the snap."
    },
    "summary": {
      "type": "string",
      "description": "Short one-line description."
    },
    "description": {
      "type": "string",
      "description": "Full description of the snap."
    },
    "publisher": {
      "type": "object",
      "properties": {
        "id": { "type": "string" },
        "username": { "type": "string" },
        "display-name": { "type": "string" }
      },
      "description": "Publisher information."
    },
    "channels": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "channel": { "type": "string" },
          "revision": { "type": "integer" },
          "version": { "type": "string" },
          "released-at": { "type": "string", "format": "date-time" },
          "size": { "type": "integer" }
        }
      },
      "description": "Available release channels and their revisions."
    },
    "categories": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": { "type": "string" }
        }
      },
      "description": "Snap categories."
    },
    "license": {
      "type": "string",
      "description": "SPDX license identifier."
    },
    "media": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "width": { "type": "integer" },
          "height": { "type": "integer" }
        }
      },
      "description": "Screenshots and icons."
    }
  }
}
