{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rewio-ru/json-schema/rewio-ru-link-v3-schema.json",
  "title": "LinkV3",
  "description": "Ссылка объекта на одной площадке.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rewio-ru-links-api-openapi.yml#/components/schemas/LinkV3",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id",
      "description": "Идентификатор ссылки."
    },
    "url": {
      "type": "string",
      "title": "Url",
      "description": "URL страницы объекта на площадке."
    },
    "source_id": {
      "type": "integer",
      "title": "Source Id",
      "description": "Идентификатор площадки ссылки (см. `GET /v3/sources`)."
    },
    "link_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Link Name",
      "description": "Своё название ссылки внутри объекта, если задано."
    },
    "auto_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Auto Name",
      "description": "Название, определённое нами по ссылке, с подписью площадки через двоеточие. Показывать стоит `link_name`, если задано, иначе `auto_name`."
    },
    "is_active": {
      "type": "boolean",
      "title": "Is Active",
      "description": "Включена ли ссылка в автосбор отзывов."
    },
    "scrape_status": {
      "$ref": "#/$defs/ScrapeStatus",
      "description": "Статус последнего сбора: `pending` / `in_progress` / `success` / `failed`."
    },
    "scrape_error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Scrape Error",
      "description": "Текст ошибки последнего неудачного сбора. `null`, когда сбор успешен."
    },
    "last_scraped_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Scraped At",
      "description": "Момент последнего сбора по ссылке (UTC, ISO 8601)."
    },
    "last_scraped_review_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Scraped Review Date",
      "description": "Дата публикации самого свежего собранного отзыва по ссылке."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At",
      "description": "Момент добавления ссылки в объект (UTC, ISO 8601)."
    }
  },
  "type": "object",
  "required": [
    "id",
    "url",
    "source_id",
    "is_active",
    "scrape_status",
    "created_at"
  ],
  "$defs": {
    "ScrapeStatus": {
      "type": "string",
      "enum": [
        "pending",
        "in_progress",
        "success",
        "failed"
      ],
      "title": "ScrapeStatus",
      "description": "Статус последнего сбора отзывов по ссылке.\n\n    \n    "
    }
  }
}