{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://socialcrawl.dev/schemas/review.json",
  "title": "SocialCrawl Review",
  "description": "Canonical unified review object returned by every SocialCrawl endpoint with the Review/ReviewList archetype. Nullability is expressed via JSON Schema 2020-12 type arrays. Generated from the Zod schema in packages/social-api/src/schemas/canonical.ts.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Review ID (parsed from the review URL when not first-class)"
    },
    "entity_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "ID of the reviewed entity (e.g. the Amazon ASIN)"
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "description": "String at review.url"
    },
    "title": {
      "type": [
        "string",
        "null"
      ],
      "description": "String at review.title"
    },
    "text": {
      "type": [
        "string",
        "null"
      ],
      "description": "Full review body"
    },
    "rating": {
      "type": "object",
      "description": "Star rating (value + max)",
      "properties": {
        "value": {
          "type": [
            "number",
            "null"
          ],
          "description": "Numeric at review.rating.value"
        },
        "max": {
          "type": [
            "number",
            "null"
          ],
          "description": "Numeric at review.rating.max"
        }
      }
    },
    "author": {
      "type": "object",
      "description": "Nested object: review.author",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at review.author.name"
        },
        "avatar_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at review.author.avatar_url"
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at review.author.url"
        },
        "location": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at review.author.location"
        },
        "reviews_count": {
          "type": [
            "number",
            "null"
          ],
          "description": "Numeric at review.author.reviews_count"
        }
      }
    },
    "helpful_votes": {
      "type": [
        "number",
        "null"
      ],
      "description": "Helpful-vote count (Amazon; null elsewhere)"
    },
    "verified": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Verified-purchase flag (Amazon; null elsewhere)"
    },
    "source": {
      "type": [
        "string",
        "null"
      ],
      "description": "String at review.source"
    },
    "language": {
      "type": [
        "string",
        "null"
      ],
      "description": "String at review.language"
    },
    "original_language": {
      "type": [
        "string",
        "null"
      ],
      "description": "String at review.original_language"
    },
    "translated": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Boolean at review.translated"
    },
    "images": {
      "type": [
        "array",
        "null"
      ],
      "description": "Array at review.images",
      "items": {
        "type": "string",
        "description": "String at review.images"
      }
    },
    "responses": {
      "type": [
        "array",
        "null"
      ],
      "description": "Owner/brand/management replies to the review, each `{id, author, text, published_at}` with `published_at` as an ISO 8601 UTC string (REL-07.6).",
      "items": {
        "type": "object",
        "description": "Owner/brand/management replies to the review, each `{id, author, text, published_at}` with `published_at` as an ISO 8601 UTC string (REL-07.6).",
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "String at review.responses.id"
          },
          "author": {
            "type": [
              "string",
              "null"
            ],
            "description": "String at review.responses.author"
          },
          "text": {
            "type": [
              "string",
              "null"
            ],
            "description": "String at review.responses.text"
          },
          "published_at": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Union: string | number | null"
          }
        }
      }
    },
    "published_at": {
      "type": [
        "string",
        "number",
        "null"
      ],
      "description": "Review creation timestamp as an ISO 8601 UTC string (REL-07.6). Upstreams that send only a calendar date land on midnight UTC. When the upstream sent a Unix epoch it is converted here and the raw epoch is preserved under `review.ext.published_at_epoch`."
    },
    "ext": {
      "type": [
        "object",
        "null"
      ],
      "description": "Nested object: review.ext",
      "properties": {
        "appdata": {
          "type": [
            "object",
            "null"
          ],
          "description": "Object at review.ext.appdata"
        },
        "tiktokshop": {
          "type": [
            "object",
            "null"
          ],
          "description": "Object at review.ext.tiktokshop"
        },
        "naver": {
          "type": [
            "object",
            "null"
          ],
          "description": "Nested object: review.ext.naver",
          "properties": {
            "visit_count": {
              "type": [
                "number",
                "null"
              ],
              "description": "Numeric at review.ext.naver.visit_count"
            },
            "verified_by": {
              "type": [
                "string",
                "null"
              ],
              "description": "String at review.ext.naver.verified_by"
            },
            "treatment": {
              "type": [
                "string",
                "null"
              ],
              "description": "String at review.ext.naver.treatment"
            },
            "view_count": {
              "type": [
                "number",
                "null"
              ],
              "description": "Numeric at review.ext.naver.view_count"
            },
            "keywords": {
              "type": [
                "array",
                "null"
              ],
              "description": "Array at review.ext.naver.keywords",
              "items": {
                "type": "string",
                "description": "String at review.ext.naver.keywords"
              }
            },
            "dedupe_key": {
              "type": [
                "string",
                "null"
              ],
              "description": "String at review.ext.naver.dedupe_key"
            }
          }
        }
      }
    }
  },
  "additionalProperties": true
}
