{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/devarmor/json-schema/devarmor-document-schema.json",
  "title": "Document",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/devarmor-documents-api-openapi.yml#/components/schemas/Document",
  "properties": {
    "symbolic_name": {
      "type": "string",
      "pattern": "^[0-9a-z-]+$",
      "title": "Symbolic Name"
    },
    "title": {
      "type": "string",
      "title": "Title"
    },
    "text": {
      "type": "string",
      "title": "Text"
    },
    "topics": {
      "items": {
        "type": "string",
        "pattern": "^[0-9a-z-]+$"
      },
      "type": "array",
      "title": "Topics"
    },
    "source_platform": {
      "anyOf": [
        {
          "$ref": "#/$defs/DocumentPlatform"
        },
        {
          "type": "null"
        }
      ]
    },
    "source_view_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Source View Url"
    },
    "source_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Source Id"
    },
    "mime_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Mime Type"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "blob": {
      "anyOf": [
        {
          "$ref": "#/$defs/Blob"
        },
        {
          "type": "null"
        }
      ]
    },
    "threat_model_versions": {
      "items": {
        "type": "string",
        "pattern": "^\\d+(\\.\\d+)*$"
      },
      "type": "array",
      "title": "Threat Model Versions"
    },
    "threat_model_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Threat Model Id"
    },
    "design_reviews": {
      "items": {
        "$ref": "#/$defs/DesignReview"
      },
      "type": "array",
      "title": "Design Reviews"
    }
  },
  "type": "object",
  "required": [
    "symbolic_name",
    "title",
    "text",
    "id",
    "threat_model_versions",
    "design_reviews"
  ],
  "$defs": {
    "Blob": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "is_uploaded": {
          "type": "boolean",
          "title": "Is Uploaded"
        },
        "file_id": {
          "type": "string",
          "format": "uuid",
          "title": "File Id"
        },
        "mime_type": {
          "type": "string",
          "title": "Mime Type"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        },
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Url"
        }
      },
      "type": "object",
      "required": [
        "name",
        "is_uploaded",
        "file_id",
        "mime_type",
        "id"
      ],
      "title": "Blob"
    },
    "DesignReview": {
      "properties": {
        "symbolic_name": {
          "type": "string",
          "pattern": "^[0-9a-z-]+$",
          "title": "Symbolic Name"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description"
        },
        "use_memory": {
          "type": "boolean",
          "title": "Use Memory",
          "default": true
        },
        "parent_ext_task_key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Parent Ext Task Key"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        },
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "scope_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Scope Id"
        },
        "memory_effective": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Memory Effective"
        },
        "memory_effective_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Memory Effective Reason"
        }
      },
      "type": "object",
      "required": [
        "symbolic_name",
        "title",
        "id"
      ],
      "title": "DesignReview"
    },
    "DocumentPlatform": {
      "type": "string",
      "enum": [
        "atlassian",
        "atlassian_jira",
        "atlassian_confluence",
        "google",
        "github_wiki"
      ],
      "title": "DocumentPlatform"
    }
  }
}