{
  "openapi": "3.1.0",
  "info": {
    "title": "Virendra Vyas, portfolio API",
    "version": "v1",
    "summary": "Read-only JSON for everything on this site.",
    "description": "Static JSON generated at build time from the same typed content as the pages. No authentication, no cookies, no tracking. Every response is validated against this document in CI.",
    "contact": {
      "name": "Virendra Vyas",
      "email": "virendra1629@gmail.com"
    }
  },
  "servers": [
    {
      "url": "https://virendravyas.dev"
    }
  ],
  "paths": {
    "/api/v1/index.json": {
      "get": {
        "operationId": "getIndex",
        "summary": "API index",
        "description": "Entry point. Links to every other resource.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "links"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Index"
                    },
                    "links": {
                      "$ref": "#/components/schemas/Links"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/profile.json": {
      "get": {
        "operationId": "getProfile",
        "summary": "Profile",
        "description": "Who I am, where I'm based, right to work, availability and how to reach me.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "links"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Profile"
                    },
                    "links": {
                      "$ref": "#/components/schemas/Links"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/case-studies.json": {
      "get": {
        "operationId": "listCaseStudies",
        "summary": "Case studies",
        "description": "Summaries of every case study, in the order the Work page shows them.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "links"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CaseStudySummary"
                      }
                    },
                    "links": {
                      "$ref": "#/components/schemas/Links"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/case-studies/{slug}.json": {
      "get": {
        "operationId": "getCaseStudy",
        "summary": "One case study",
        "description": "The full write-up: problem, what I did, outcome and honest status.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "govbridge",
                "devicehub",
                "stringline",
                "connectresearch",
                "intellibooks"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "links"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CaseStudy"
                    },
                    "links": {
                      "$ref": "#/components/schemas/Links"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/timeline.json": {
      "get": {
        "operationId": "getTimeline",
        "summary": "Career timeline",
        "description": "Roles with start and end months (YYYY-MM). Current roles have a null end.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "links"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TimelineEntry"
                      }
                    },
                    "links": {
                      "$ref": "#/components/schemas/Links"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/skills.json": {
      "get": {
        "operationId": "getSkills",
        "summary": "Skills, with evidence",
        "description": "Skill groups, each linking to the work where the skill was used.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "links"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SkillGroup"
                      }
                    },
                    "links": {
                      "$ref": "#/components/schemas/Links"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/writing.json": {
      "get": {
        "operationId": "getWriting",
        "summary": "Writing and open source",
        "description": "Articles and merged open-source contributions.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data",
                    "links"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Writing"
                    },
                    "links": {
                      "$ref": "#/components/schemas/Links"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Links": {
        "type": "object",
        "description": "Related resources. `self` is this response; `html` is the matching page.",
        "properties": {
          "self": {
            "type": "string"
          },
          "html": {
            "type": "string"
          }
        },
        "additionalProperties": {
          "type": "string"
        },
        "required": [
          "self"
        ]
      },
      "Link": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "label",
          "href"
        ],
        "properties": {
          "label": {
            "type": "string"
          },
          "href": {
            "type": "string"
          }
        }
      },
      "Section": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "heading",
          "paragraphs",
          "points"
        ],
        "properties": {
          "heading": {
            "type": "string"
          },
          "paragraphs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "points": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Status": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "label"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "live",
              "production",
              "prototype",
              "complete",
              "notLaunched"
            ]
          },
          "label": {
            "type": "string"
          }
        }
      },
      "Index": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "description",
          "version"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "version": {
            "type": "string",
            "const": "v1"
          }
        }
      },
      "Profile": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "role",
          "headline",
          "summary",
          "location",
          "rightToWork",
          "availability",
          "workingArrangements",
          "contact",
          "education",
          "certifications",
          "languages"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "headline": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "rightToWork": {
            "type": "string"
          },
          "availability": {
            "type": "string"
          },
          "workingArrangements": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "contact": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "email",
              "links"
            ],
            "properties": {
              "email": {
                "type": "string",
                "format": "email"
              },
              "links": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Link"
                }
              }
            }
          },
          "education": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title",
                "institution",
                "period"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "institution": {
                  "type": "string"
                },
                "period": {
                  "type": "string"
                }
              }
            }
          },
          "certifications": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title",
                "note"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "note": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CaseStudySummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "slug",
          "title",
          "summary",
          "role",
          "context",
          "period",
          "status",
          "tech",
          "links"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "context": {
            "type": "string"
          },
          "period": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "tech": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "links": {
            "$ref": "#/components/schemas/Links"
          }
        }
      },
      "CaseStudy": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "slug",
          "title",
          "summary",
          "role",
          "context",
          "period",
          "status",
          "tech",
          "externalLinks",
          "diagram",
          "problem",
          "whatIDid",
          "outcome",
          "honestStatus",
          "next"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "context": {
            "type": "string"
          },
          "period": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "tech": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "externalLinks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Link"
            }
          },
          "diagram": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "href",
                  "description"
                ],
                "properties": {
                  "href": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  }
                }
              }
            ]
          },
          "problem": {
            "$ref": "#/components/schemas/Section"
          },
          "whatIDid": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Section"
            }
          },
          "outcome": {
            "$ref": "#/components/schemas/Section"
          },
          "honestStatus": {
            "$ref": "#/components/schemas/Section"
          },
          "next": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Section"
              }
            ]
          }
        }
      },
      "TimelineEntry": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "organisation",
          "role",
          "kind",
          "start",
          "end",
          "current",
          "summary",
          "caseStudy"
        ],
        "properties": {
          "organisation": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "employment",
              "company",
              "freelance"
            ]
          },
          "start": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}$"
          },
          "end": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d{4}-\\d{2}$"
          },
          "current": {
            "type": "boolean"
          },
          "summary": {
            "type": "string"
          },
          "caseStudy": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "SkillGroup": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "items",
          "evidence"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "evidence": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Link"
            }
          }
        }
      },
      "Writing": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "articles",
          "openSource"
        ],
        "properties": {
          "articles": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title",
                "summary",
                "platform",
                "href"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "summary": {
                  "type": "string"
                },
                "platform": {
                  "type": "string"
                },
                "href": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "openSource": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title",
                "project",
                "summary",
                "href"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "project": {
                  "type": "string"
                },
                "summary": {
                  "type": "string"
                },
                "href": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
