{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cherishedbook-com/json-schema/cherishedbook-com-contribution-schema.json",
  "title": "Contribution",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cherishedbook-com-openapi.yml#/components/schemas/Contribution",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "type",
    "title",
    "body",
    "author",
    "status",
    "is_approved",
    "is_private",
    "is_pinned",
    "is_hidden",
    "heart_count",
    "moderation",
    "can_approve",
    "created_at"
  ],
  "properties": {
    "id": {
      "type": "integer"
    },
    "type": {
      "type": [
        "string",
        "null"
      ]
    },
    "title": {
      "type": [
        "string",
        "null"
      ]
    },
    "body": {
      "type": [
        "string",
        "null"
      ]
    },
    "author": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "email",
        "is_guest"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "email": {
          "type": [
            "string",
            "null"
          ]
        },
        "is_guest": {
          "type": "boolean"
        }
      }
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "approved",
        "rejected",
        "hidden"
      ]
    },
    "is_approved": {
      "type": "boolean"
    },
    "is_private": {
      "type": "boolean"
    },
    "is_pinned": {
      "type": "boolean"
    },
    "is_hidden": {
      "type": "boolean"
    },
    "heart_count": {
      "type": "integer",
      "minimum": 0
    },
    "moderation": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status",
        "reason"
      ],
      "properties": {
        "status": {
          "type": [
            "string",
            "null"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "can_approve": {
      "type": "boolean"
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}