{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/wordlift-io/json-schema/wordlift-io-record-schema.json",
  "title": "Record",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/wordlift-io-content-generation.yml#/components/schemas/Record",
  "type": "object",
  "properties": {
    "completion": {
      "type": "string"
    },
    "content_generation_id": {
      "type": "integer",
      "format": "int64",
      "description": "The parent content generation id.",
      "readOnly": true
    },
    "data": {
      "$ref": "#/$defs/Json"
    },
    "errors": {
      "type": "array",
      "description": "The set of errors found for record.",
      "items": {
        "$ref": "#/$defs/ValidationResult"
      },
      "readOnly": true
    },
    "has_upvote": {
      "type": "boolean",
      "description": "This indicates whether the user upvoted the completion."
    },
    "id": {
      "type": "integer",
      "format": "int64"
    },
    "is_accepted": {
      "type": "boolean",
      "description": "This indicates whether the completion is accepted by the user."
    },
    "modified_at": {
      "type": "string",
      "format": "date-time",
      "description": "The last modified date-time.",
      "readOnly": true
    },
    "not_in_prompt_words": {
      "type": "array",
      "description": "Words in completion that are not in the prompt.",
      "items": {
        "type": "string",
        "description": "Words in completion that are not in the prompt.",
        "readOnly": true
      },
      "readOnly": true,
      "uniqueItems": true
    },
    "prompt": {
      "type": "string",
      "description": "The prompt."
    },
    "repeated_words": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/WordRepetitionData"
      },
      "description": "Words in completion which are repeated.",
      "readOnly": true
    },
    "status": {
      "type": "string",
      "description": "The status of the record, whether it's accepted, with errors, with warnings or valid.",
      "enum": [
        "accepted",
        "warnings",
        "errors",
        "valid"
      ],
      "readOnly": true
    },
    "validated_at": {
      "type": "string",
      "format": "date-time",
      "description": "The last validation date-time.",
      "readOnly": true
    },
    "warnings": {
      "type": "array",
      "description": "The set of errors found for record.",
      "items": {
        "$ref": "#/$defs/ValidationResult"
      },
      "readOnly": true
    }
  },
  "required": [
    "content_generation_id",
    "has_upvote",
    "is_accepted",
    "prompt"
  ],
  "$defs": {
    "Json": {
      "type": "object",
      "description": "The data from knowledge graph after applying the graphql query.",
      "readOnly": true
    },
    "LevelEnum": {
      "type": "string",
      "description": "The rule level.",
      "enum": [
        "RECOMMENDED",
        "REQUIRED"
      ]
    },
    "ValidationResult": {
      "type": "object",
      "description": "The set of warnings found for the answer.",
      "properties": {
        "levelEnum": {
          "$ref": "#/$defs/LevelEnum"
        },
        "name": {
          "type": "string"
        },
        "result": {
          "type": "string",
          "enum": [
            "PASS",
            "FAIL",
            "SKIP",
            "FIXED"
          ]
        }
      },
      "readOnly": true
    },
    "WordRepetitionData": {
      "type": "object",
      "description": "Words in completion which are repeated.",
      "properties": {
        "count": {
          "type": "integer",
          "format": "int32"
        },
        "repeated_in_same_sentence": {
          "type": "boolean"
        }
      },
      "readOnly": true
    }
  }
}