{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/openhandle/json-schema/openhandle-reddit-comment-schema.json",
  "title": "RedditComment",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openhandle-reddit-api-openapi.yml#/components/schemas/RedditComment",
  "additionalProperties": false,
  "properties": {
    "author": {
      "anyOf": [
        {
          "$ref": "#/$defs/RedditAuthor"
        },
        {
          "type": "null"
        }
      ]
    },
    "community": {
      "anyOf": [
        {
          "$ref": "#/$defs/RedditCommunity"
        },
        {
          "type": "null"
        }
      ]
    },
    "createdAt": {
      "format": "date-time",
      "minLength": 1,
      "type": "string"
    },
    "depth": {
      "type": [
        "integer",
        "null"
      ]
    },
    "display": {
      "$ref": "#/$defs/RedditCommentDisplay"
    },
    "distinguishedBy": {
      "minLength": 1,
      "type": [
        "string",
        "null"
      ]
    },
    "editedAt": {
      "format": "date-time",
      "minLength": 1,
      "type": [
        "string",
        "null"
      ]
    },
    "id": {
      "minLength": 1,
      "type": "string"
    },
    "isArchived": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "isByPostAuthor": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "isControversial": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "isEdited": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "isLocked": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "isStickied": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "metrics": {
      "$ref": "#/$defs/RedditCommentMetrics"
    },
    "parentId": {
      "minLength": 1,
      "type": [
        "string",
        "null"
      ]
    },
    "postId": {
      "minLength": 1,
      "type": [
        "string",
        "null"
      ]
    },
    "replies": {
      "items": {
        "$ref": "#/$defs/RedditCommentReference"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "text": {
      "minLength": 1,
      "type": [
        "string",
        "null"
      ]
    },
    "textHtml": {
      "minLength": 1,
      "type": [
        "string",
        "null"
      ]
    },
    "type": {
      "minLength": 1,
      "type": [
        "string",
        "null"
      ]
    },
    "url": {
      "format": "uri",
      "minLength": 1,
      "type": "string"
    },
    "visibility": {
      "$ref": "#/$defs/RedditCommentVisibility"
    }
  },
  "required": [
    "id",
    "text",
    "textHtml",
    "author",
    "community",
    "postId",
    "parentId",
    "url",
    "metrics",
    "visibility",
    "isByPostAuthor",
    "isStickied",
    "isLocked",
    "isArchived",
    "distinguishedBy",
    "type",
    "display",
    "createdAt",
    "isEdited",
    "editedAt",
    "isControversial",
    "depth",
    "replies"
  ],
  "type": "object",
  "$defs": {
    "RedditAuthor": {
      "additionalProperties": false,
      "properties": {
        "flair": {
          "anyOf": [
            {
              "$ref": "#/$defs/RedditFlair"
            },
            {
              "type": "null"
            }
          ]
        },
        "handle": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "isPremium": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "placeholder": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "handle",
        "placeholder",
        "isPremium",
        "flair"
      ],
      "type": "object"
    },
    "RedditCommentDisplay": {
      "additionalProperties": false,
      "properties": {
        "collapsedReason": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "isCollapsed": {
          "type": [
            "boolean",
            "null"
          ]
        }
      },
      "required": [
        "isCollapsed",
        "collapsedReason"
      ],
      "type": "object"
    },
    "RedditCommentMetrics": {
      "additionalProperties": false,
      "properties": {
        "awards": {
          "type": [
            "integer",
            "null"
          ]
        },
        "gilded": {
          "type": [
            "integer",
            "null"
          ]
        },
        "score": {
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "score",
        "awards",
        "gilded"
      ],
      "type": "object"
    },
    "RedditCommentReference": {
      "additionalProperties": false,
      "properties": {
        "author": {
          "anyOf": [
            {
              "$ref": "#/$defs/RedditAuthor"
            },
            {
              "type": "null"
            }
          ]
        },
        "community": {
          "anyOf": [
            {
              "$ref": "#/$defs/RedditCommunity"
            },
            {
              "type": "null"
            }
          ]
        },
        "createdAt": {
          "format": "date-time",
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "depth": {
          "type": [
            "integer",
            "null"
          ]
        },
        "display": {
          "$ref": "#/$defs/RedditCommentDisplay"
        },
        "distinguishedBy": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "editedAt": {
          "format": "date-time",
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "isArchived": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "isByPostAuthor": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "isControversial": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "isEdited": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "isLocked": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "isStickied": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "metrics": {
          "$ref": "#/$defs/RedditCommentMetrics"
        },
        "parentId": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "postId": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "replies": {
          "items": {
            "$ref": "#/$defs/RedditCommentReference"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "text": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "textHtml": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "url": {
          "format": "uri",
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "visibility": {
          "$ref": "#/$defs/RedditCommentVisibility"
        }
      },
      "required": [
        "id",
        "text",
        "textHtml",
        "author",
        "community",
        "postId",
        "parentId",
        "url",
        "metrics",
        "visibility",
        "isByPostAuthor",
        "isStickied",
        "isLocked",
        "isArchived",
        "distinguishedBy",
        "type",
        "display",
        "createdAt",
        "isEdited",
        "editedAt",
        "isControversial",
        "depth",
        "replies"
      ],
      "type": "object"
    },
    "RedditCommentVisibility": {
      "additionalProperties": false,
      "properties": {
        "isScoreHidden": {
          "type": [
            "boolean",
            "null"
          ]
        }
      },
      "required": [
        "isScoreHidden"
      ],
      "type": "object"
    },
    "RedditCommunity": {
      "additionalProperties": false,
      "properties": {
        "displayHandle": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "handle": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "isQuarantined": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "metrics": {
          "$ref": "#/$defs/RedditSubredditMetrics"
        },
        "type": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "handle",
        "displayHandle",
        "type",
        "metrics",
        "isQuarantined"
      ],
      "type": "object"
    },
    "RedditFlair": {
      "additionalProperties": false,
      "properties": {
        "backgroundColor": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "cssClass": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "hasPatreonFlair": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "templateId": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "text": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "textColor": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "minLength": 1,
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "text",
        "type",
        "templateId",
        "cssClass",
        "backgroundColor",
        "textColor",
        "hasPatreonFlair"
      ],
      "type": "object"
    },
    "RedditSubredditMetrics": {
      "additionalProperties": false,
      "properties": {
        "subscribers": {
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "subscribers"
      ],
      "type": "object"
    }
  }
}