{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schema/resume-1.json",
  "title": "John.CVLab resume",
  "description": "A resume document for John.CVLab. `basics` is typed; everything else is a generic section. Size limits exist so a shared link can never hang a visitor's browser.",
  "type": "object",
  "required": ["basics", "sections"],
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "type": "string",
      "description": "The schema this document is validated against. Read-only — the schema is the contract that makes 'valid' mean something.",
      "maxLength": 200
    },
    "theme": {
      "type": "string",
      "description": "Name of the theme preset this document starts from. Visual settings live in theme.json, not here.",
      "examples": ["broadsheet", "grid"],
      "maxLength": 40
    },
    "basics": {
      "type": "object",
      "description": "Who this resume belongs to. The only typed part of the document — it feeds the masthead and the structured data.",
      "required": ["name"],
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "description": "Full name, as it should appear in the masthead and the PDF filename.",
          "minLength": 1,
          "maxLength": 120,
          "examples": ["Ada Lovelace"]
        },
        "label": {
          "type": "string",
          "description": "One-line professional title shown under the name, e.g. 'Software Engineer'.",
          "maxLength": 160,
          "examples": ["Software Engineer"]
        },
        "email": {
          "type": "string",
          "description": "Contact email, rendered as text in the document header.",
          "maxLength": 160,
          "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",
          "examples": ["you@example.com"]
        },
        "phone": {
          "type": "string",
          "description": "Contact phone number, rendered as text in the document header.",
          "maxLength": 40,
          "pattern": "^\\+?[0-9][0-9()\\-.\\s]*$",
          "examples": ["+61 400 000 000"]
        },
        "location": {
          "type": "string",
          "description": "City / region line, e.g. 'Melbourne, Australia'.",
          "maxLength": 160,
          "examples": ["Melbourne, Australia"]
        },
        "profiles": {
          "type": "array",
          "description": "Links shown in the header. Only http(s) URLs are rendered — anything else is dropped.",
          "maxItems": 8,
          "items": {
            "type": "object",
            "required": ["network", "url"],
            "additionalProperties": false,
            "properties": {
              "network": {
                "type": "string",
                "description": "Display name of the site, e.g. 'GitHub'.",
                "maxLength": 40,
                "examples": ["GitHub", "LinkedIn"]
              },
              "url": {
                "type": "string",
                "description": "Full URL including https://. Non-http(s) schemes are rejected at render time.",
                "maxLength": 300,
                "pattern": "^https?://",
                "examples": ["https://github.com/you"]
              }
            }
          }
        }
      }
    },
    "sections": {
      "type": "array",
      "description": "The body of the document, in display order (theme.json's sectionOrder can reorder them). Add any section you like — Certifications, Publications, Speaking — it's just data.",
      "maxItems": 12,
      "items": {
        "type": "object",
        "required": ["title", "entries"],
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "description": "Semantic tag consumed only by the structured-data (JSON-LD) emitter. Defaults from the title where obvious — most sections never need it.",
            "enum": ["work", "education", "project", "custom"]
          },
          "layout": {
            "type": "string",
            "description": "How entries are drawn. timeline: heading/subheading/dates/bullets. list: heading + text. prose: text only. Defaults from kind.",
            "enum": ["timeline", "list", "prose"]
          },
          "title": {
            "type": "string",
            "description": "Section heading as printed, e.g. 'Experience'.",
            "minLength": 1,
            "maxLength": 80,
            "examples": ["Experience", "Skills", "Education"]
          },
          "entries": {
            "type": "array",
            "description": "Entries in this section. Which fields are used depends on the section's layout.",
            "maxItems": 20,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "heading": {
                  "type": "string",
                  "description": "Primary line — company, school, or list label.",
                  "maxLength": 160,
                  "examples": ["Acme Corp"]
                },
                "subheading": {
                  "type": "string",
                  "description": "Secondary line — job title or degree.",
                  "maxLength": 160,
                  "examples": ["Senior Engineer"]
                },
                "start": {
                  "type": "string",
                  "description": "Start date as YYYY-MM. Structured, never pre-formatted — the theme decides how dates look.",
                  "pattern": "^\\d{4}-(0[1-9]|1[0-2])$",
                  "examples": ["2023-04"]
                },
                "end": {
                  "type": ["string", "null"],
                  "description": "End date as YYYY-MM, or null for 'Present'.",
                  "pattern": "^\\d{4}-(0[1-9]|1[0-2])$",
                  "examples": ["2024-11", null]
                },
                "bullets": {
                  "type": "array",
                  "description": "Achievement bullets (timeline layout).",
                  "maxItems": 12,
                  "items": { "type": "string", "maxLength": 500 }
                },
                "text": {
                  "type": "string",
                  "description": "Body text (list and prose layouts).",
                  "maxLength": 2000
                }
              }
            }
          }
        }
      }
    }
  }
}
