{
  "openapi": "3.0.3",
  "info": {
    "title": "Public Repository API",
    "version": "1.0.0",
    "description": "A teaching subset of GitHub's public repository lookup. The live response has more fields than this example documents.",
    "license": { "name": "MIT", "url": "https://opensource.org/license/mit" }
  },
  "servers": [{ "url": "https://api.github.com" }],
  "paths": {
    "/repos/{owner}/{repo}": {
      "get": {
        "operationId": "getRepository",
        "summary": "Get a public repository",
        "description": "Look up the name, web URL, and default branch of a public GitHub repository without credentials.",
        "externalDocs": {
          "url": "https://docs.github.com/en/rest/repos/repos#get-a-repository"
        },
        "security": [],
        "parameters": [
          { "name": "owner", "in": "path", "required": true, "schema": { "type": "string" }, "example": "octocat" },
          { "name": "repo", "in": "path", "required": true, "schema": { "type": "string" }, "example": "Hello-World" }
        ],
        "responses": {
          "200": {
            "description": "Public repository details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["full_name", "html_url", "default_branch"],
                  "properties": {
                    "full_name": { "type": "string" },
                    "html_url": { "type": "string", "format": "uri" },
                    "default_branch": { "type": "string" }
                  }
                },
                "example": {
                  "full_name": "octocat/Hello-World",
                  "html_url": "https://github.com/octocat/Hello-World",
                  "default_branch": "master"
                }
              }
            }
          },
          "404": { "description": "Repository not found or not visible to the caller" }
        }
      }
    }
  }
}
