{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/commentary-dev/json-schema/commentary-dev-form-submission-schema.json",
  "title": "FormSubmission",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/commentary-dev-forms-api-openapi.yml#/components/schemas/FormSubmission",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "formId": {
      "type": "string"
    },
    "formVersionId": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "final",
        "replaced",
        "voided"
      ]
    },
    "validationResult": {
      "type": "object",
      "additionalProperties": true
    },
    "values": {
      "type": "object",
      "description": "Raw submitted values. Requires commentary.forms.read.",
      "additionalProperties": true
    },
    "sourceContext": {
      "$ref": "#/$defs/FormSourceContext"
    },
    "sourceContextSummary": {
      "type": "object",
      "additionalProperties": true
    },
    "submissionOrigin": {
      "type": "string",
      "enum": [
        "web",
        "api",
        "mcp",
        "cli",
        "agent_api"
      ]
    },
    "submitterViewerId": {
      "type": [
        "string",
        "null"
      ]
    },
    "submitterLogin": {
      "type": [
        "string",
        "null"
      ]
    },
    "agentAlias": {
      "type": [
        "string",
        "null"
      ]
    },
    "clientName": {
      "type": [
        "string",
        "null"
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "submittedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "additionalProperties": true,
  "$defs": {
    "FormSourceContext": {
      "type": "object",
      "description": "Embedded review context such as repository owner/repo plus prNumber or branchRef, draftReviewSessionId, filePath, documentVersionId, formInstanceId, and route.",
      "additionalProperties": true
    }
  }
}