{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/reddit/json-schema/reddit-listing-schema.json",
  "title": "Listing",
  "description": "A Reddit listing is a paginated collection of things. Listings contain a data object with children and pagination information.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/reddit-links-comments-api-openapi.yml#/components/schemas/Listing",
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "description": "The kind identifier, always \"Listing\".",
      "enum": [
        "Listing"
      ]
    },
    "data": {
      "type": "object",
      "properties": {
        "after": {
          "type": [
            "string",
            "null"
          ],
          "description": "The fullname of the next item for forward pagination."
        },
        "before": {
          "type": [
            "string",
            "null"
          ],
          "description": "The fullname of the previous item for backward pagination."
        },
        "dist": {
          "type": "integer",
          "description": "The number of items in this listing."
        },
        "modhash": {
          "type": "string",
          "description": "A modhash for CSRF protection."
        },
        "children": {
          "type": "array",
          "description": "The list of things in this listing.",
          "items": {
            "$ref": "#/$defs/Thing"
          }
        }
      }
    }
  },
  "$defs": {
    "Thing": {
      "type": "object",
      "description": "A Reddit thing is the base object type. All Reddit objects (comments, links, subreddits, etc.) are things with a kind and data payload.",
      "properties": {
        "kind": {
          "type": "string",
          "description": "The kind identifier (t1 for comment, t2 for account, t3 for link, t4 for message, t5 for subreddit, t6 for award).",
          "enum": [
            "t1",
            "t2",
            "t3",
            "t4",
            "t5",
            "t6"
          ]
        },
        "data": {
          "type": "object",
          "description": "The thing's data payload, varying by kind."
        }
      }
    }
  }
}