{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/thomson-reuters/main/json-schema/thomson-reuters-api-collection-topic-dto-schema.json",
  "title": "ApiCollectionTopicDTO",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thomson-reuters-topic-service-openapi.yml#/components/schemas/ApiCollectionTopicDTO",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TopicDTO"
      }
    },
    "_meta": {
      "$ref": "#/$defs/ApiMeta"
    }
  },
  "$defs": {
    "ApiMeta": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer",
          "format": "int64"
        },
        "limit": {
          "type": "integer",
          "format": "int32"
        },
        "offset": {
          "type": "integer",
          "format": "int32"
        },
        "sort": {
          "type": "string"
        },
        "filter": {
          "type": "string"
        },
        "extra": {
          "type": "object",
          "additionalProperties": {
            "type": "object"
          },
          "writeOnly": true
        }
      }
    },
    "TopicBlueprintDTO": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "version": {
          "type": "integer",
          "format": "int32"
        },
        "type_id": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "TopicDTO": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier of the Topic"
        },
        "name": {
          "type": "string",
          "description": "Label of the Topic"
        },
        "records": {
          "$ref": "#/$defs/TopicRecordCountDTO"
        },
        "blueprint": {
          "$ref": "#/$defs/TopicBlueprintDTO"
        },
        "status": {
          "type": "string",
          "description": "Current state of the Topic",
          "enum": [
            "PUBLISHING",
            "PROCESSING",
            "COMPLETED",
            "FAILED",
            "REPROCESSING",
            "STAGED"
          ]
        },
        "year": {
          "type": "integer",
          "description": "Relevant year of importance for the file data",
          "format": "int32"
        },
        "period": {
          "type": "integer",
          "description": "Numeric period of no specific precision",
          "format": "int32"
        },
        "template_id": {
          "type": "string",
          "description": "Unique identifier of the Template"
        },
        "is_hidden": {
          "type": "boolean",
          "description": "Visibility of the Topic"
        },
        "created_by": {
          "type": "string",
          "description": "Topic created at by"
        },
        "created_at": {
          "type": "string",
          "description": "Topic created at time",
          "format": "date-time"
        }
      }
    },
    "TopicRecordCountDTO": {
      "type": "object",
      "properties": {
        "total": {
          "type": "integer",
          "description": "Number of records published to the stream. Sum of \n`ready`, `unavailable`, 'invalid 'and `ignored` records equals `total`",
          "format": "int64"
        },
        "ready": {
          "type": "integer",
          "description": "Number of records with no errors and ready for consumption",
          "format": "int64"
        },
        "unavailable": {
          "type": "integer",
          "description": "Number of records that contain values that failed an \nexternal validation check. These records can be recovered by\nreprocessing once the external system is Updated",
          "format": "int64"
        },
        "invalid": {
          "type": "integer",
          "description": "Number of records that contain unrecoverable errors. any\nexplicitly filtered rows also end up here. For example, rows \nremoved by the offset operator",
          "format": "int64"
        },
        "ignored": {
          "type": "integer",
          "description": "Number of records that are ignored during file import",
          "format": "int64"
        }
      }
    }
  }
}