{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zoomin/json-schema/zoomin-resource-topic-schema.json",
  "title": "Resource Topic",
  "description": "Information about a [resource](https://docs.zoominsoftware.com/bundle/ZCI/page/about_resources.html) in a resource bundle.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zoomin-openapi.yml#/components/schemas/ResourceTopic",
  "required": [
    "attachments",
    "bundle_id",
    "bundle_title",
    "dates",
    "dislikes",
    "is_liked",
    "is_watched",
    "keywords",
    "labels",
    "likes",
    "metadata",
    "page_id",
    "page_key",
    "title",
    "views"
  ],
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "The title of this resource."
    },
    "views": {
      "minimum": 0,
      "type": "integer",
      "description": "The number of views of this resource."
    },
    "dates": {
      "$ref": "#/$defs/Dates"
    },
    "likes": {
      "minimum": 0,
      "type": "integer",
      "description": "The number of likes of this resource."
    },
    "dislikes": {
      "minimum": 0,
      "type": "integer",
      "description": "The number of dislikes of this resource."
    },
    "metadata": {
      "type": "object",
      "properties": {},
      "description": "Metadata key-value pairs specified for this resource. Both topic-level metadata and bundle-level metadata are included."
    },
    "labels": {
      "type": "array",
      "description": "The labels applied to this resource in the classification map.",
      "items": {
        "$ref": "#/$defs/Label"
      }
    },
    "keywords": {
      "type": "array",
      "description": "The keywords for this resource.",
      "items": {
        "type": "string"
      }
    },
    "attachments": {
      "$ref": "#/$defs/TopicAttachments"
    },
    "bundle_title": {
      "type": "string",
      "description": "The title of the bundle containing this resource."
    },
    "page_id": {
      "type": "string",
      "description": "The path and file name of the resource within the bundle."
    },
    "bundle_id": {
      "type": "string",
      "description": "The bundle ID of the bundle."
    },
    "bundle_landing_page": {
      "type": "string",
      "description": "The landing page for the bundle. For resource bundles, the landing page is the path and file name of the resource within the bundle."
    },
    "is_watched": {
      "type": "boolean",
      "description": "Whether any user has subscribed to this resource."
    },
    "is_in_fav": {
      "type": "boolean",
      "description": "Whether this resource is in included in a collection for any user."
    },
    "is_liked": {
      "$ref": "#/$defs/IsLiked"
    },
    "page_key": {
      "$ref": "#/$defs/PageKey"
    },
    "bundle_subtitle": {
      "type": "string",
      "description": "The subtitle of the bundle containing this resource."
    }
  },
  "$defs": {
    "Attachment": {
      "title": "Attachment",
      "required": [
        "filename",
        "url"
      ],
      "type": "object",
      "properties": {
        "filename": {
          "type": "string",
          "description": "The file name of the attachment."
        },
        "url": {
          "type": "string",
          "description": "A link to download the attachment.",
          "format": "url"
        }
      },
      "description": "A file that is attached to a bundle or topic."
    },
    "Dates": {
      "title": "Dates",
      "required": [
        "Added on",
        "Initial upload"
      ],
      "type": "object",
      "properties": {
        "Created on": {
          "type": "string",
          "description": "The date when the content was created. Provided by the authoring tool or upload plug-in.",
          "format": "date-time"
        },
        "Initial upload": {
          "type": "string",
          "description": "The date when the content was first uploaded. This is automatically added by Zoomin.",
          "format": "date-time"
        },
        "Updated on": {
          "type": "string",
          "description": "The date when the content was last updated. Provided by the authoring tool or upload plug-in.",
          "format": "date-time"
        },
        "Added on": {
          "type": "string",
          "description": "The date when the content was last uploaded. This is automatically added by Zoomin.",
          "format": "date-time"
        }
      },
      "description": "The dates associated with a bundle or topic. All dates are in the UTC time zone."
    },
    "IsLiked": {
      "title": "Is Liked",
      "type": "boolean",
      "description": "If this content was voted on, whether it was liked (`true`) or disliked (`false`)."
    },
    "Label": {
      "title": "Taxonomy label",
      "required": [
        "aliases",
        "hidden",
        "key",
        "navtitle",
        "outputclasses",
        "visibility"
      ],
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "The primary identifier of this label",
          "format": "label-id"
        },
        "aliases": {
          "type": "array",
          "description": "Additional identifiers for this label",
          "items": {
            "type": "string",
            "format": "label-id"
          }
        },
        "navtitle": {
          "type": "string",
          "description": "Human readable name of the label in the default language"
        },
        "subjectHeadId": {
          "type": "string",
          "description": "The label-id of the top-level label in the subject scheme that contains this label. If this facet is itself at the top level, this field is `null`.",
          "format": "label-id"
        },
        "subjectheadNavtitle": {
          "type": "string",
          "description": "Human readable name of the top-level label in the subject scheme that contains this label. If this facet is itself at the top level, this field is `null`."
        },
        "hidden": {
          "type": "boolean",
          "description": "Whether this label should be hidden from end users in the search UI"
        },
        "outputclasses": {
          "type": "array",
          "description": "Custom HTML output classes that are applied to this label in the search UI. Does not include built-in output classes that enable Zoomin features.",
          "items": {
            "type": "string"
          }
        },
        "visibility": {
          "title": "Label UI visibility property",
          "type": "string",
          "description": "Indicates the parts of the UI that have been selected in the subject scheme for the label to be visible. Deprecated - use output classes instead.",
          "deprecated": true,
          "enum": [
            "hide-facet",
            "advanced-search",
            "refine-search",
            "show-facet"
          ]
        },
        "isSubjectHead": {
          "type": "boolean",
          "description": "Whether this label is at the top level in the subject scheme"
        }
      },
      "description": "A taxonomy label from the subject scheme. Used to classify content in classification maps for use in search and to assign content permissions in CRGs."
    },
    "PageKey": {
      "title": "Page Key",
      "minimum": 0,
      "type": "integer",
      "description": "The numeric ID of the page. The numeric ID is required for certain API features, such as comments and ratings."
    },
    "TopicAttachments": {
      "title": "Topic Attachments",
      "type": "object",
      "properties": {
        "topic_attachments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Attachment"
          }
        },
        "all_attachments": {
          "type": "string",
          "description": "A link to download all topic attachments as a single zip file.",
          "format": "url"
        }
      },
      "description": "The files attached to this topic."
    }
  }
}