{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getmattered/json-schema/getmattered-apply-document-patch-request-schema.json",
  "title": "ApplyDocumentPatchRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getmattered-applications-api-openapi.yml#/components/schemas/ApplyDocumentPatchRequest",
  "type": "object",
  "properties": {
    "documentType": {
      "type": "string",
      "enum": [
        "resume",
        "cover-letter"
      ],
      "description": "Which document the applied patch mutated: resume or coverLetter"
    },
    "content": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200000,
      "description": "Final document markdown after client-applied chat patches"
    },
    "patchCount": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "description": "Number of DocumentPatch entries the client applied to produce `content`"
    },
    "structuredResume": {
      "type": "object",
      "properties": {
        "certifications": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "education": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EducationEntry"
          }
        },
        "experience": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExperienceEntry"
          }
        },
        "personalInfo": {
          "$ref": "#/$defs/PersonalInfo"
        },
        "skills": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "summary": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false,
      "description": "Final structured tailored-resume snapshot. Resume clients send this beside content so section edits remain available to form and template views."
    }
  },
  "required": [
    "documentType",
    "content",
    "patchCount"
  ],
  "additionalProperties": false,
  "$defs": {
    "EducationEntry": {
      "type": "object",
      "properties": {
        "degree": {
          "type": "string"
        },
        "endDate": {
          "type": [
            "string",
            "null"
          ]
        },
        "gpa": {
          "type": [
            "string",
            "null"
          ]
        },
        "highlights": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "institution": {
          "type": "string"
        },
        "location": {
          "type": [
            "string",
            "null"
          ]
        },
        "startDate": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "degree",
        "institution"
      ],
      "additionalProperties": false
    },
    "ExperienceEntry": {
      "type": "object",
      "properties": {
        "bullets": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "company": {
          "type": "string"
        },
        "current": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "endDate": {
          "type": [
            "string",
            "null"
          ]
        },
        "location": {
          "type": [
            "string",
            "null"
          ]
        },
        "startDate": {
          "type": "string"
        },
        "title": {
          "type": "string"
        }
      },
      "required": [
        "bullets",
        "company",
        "startDate",
        "title"
      ],
      "additionalProperties": false
    },
    "PersonalInfo": {
      "type": "object",
      "properties": {
        "email": {
          "anyOf": [
            {
              "type": "string",
              "format": "email"
            },
            {
              "type": "string",
              "enum": [
                ""
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "fullName": {
          "type": [
            "string",
            "null"
          ]
        },
        "linkedin": {
          "type": [
            "string",
            "null"
          ]
        },
        "location": {
          "type": [
            "string",
            "null"
          ]
        },
        "phone": {
          "type": [
            "string",
            "null"
          ]
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "website": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    }
  }
}