World Class Software Engineer

World Class Software Engineer · GPT 작업

GitHub API

API for interacting with GitHub, including repository management and authentication.

  • GET /login/oauth/authorizeInitiate OAuth Flow
  • GET /callbackHandle OAuth Callback
  • POST /login/oauth/access_tokenExchange Authorization Code for Access Token
  • GET /user/reposList Repositories
  • POST /user/reposCreate Repository
  • DELETE /repos/{owner}/{repo}Delete Repository
  • GET /userGet User Profile
원본 API 스키마
{
  "openapi": "3.1.0",
  "info": {
    "title": "GitHub API",
    "version": "1.0.0",
    "description": "API for interacting with GitHub, including repository management and authentication."
  },
  "servers": [
    {
      "url": "https://api.github.com",
      "description": "GitHub API server"
    }
  ],
  "paths": {
    "/login/oauth/authorize": {
      "get": {
        "operationId": "initiateOAuthFlow",
        "summary": "Initiate OAuth Flow",
        "parameters": [
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to authorization page"
          },
          "400": {
            "description": "Bad Request - Invalid Request Parameters"
          }
        }
      }
    },
    "/callback": {
      "get": {
        "operationId": "handleOAuthCallback",
        "summary": "Handle OAuth Callback",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Received authorization code"
          },
          "401": {
            "description": "Unauthorized - Invalid Callback Code"
          }
        }
      }
    },
    "/login/oauth/access_token": {
      "post": {
        "operationId": "exchangeCodeForToken",
        "summary": "Exchange Authorization Code for Access Token",
        "requestBody": {
          "description": "Authorization code received from callback",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  }
                },
                "required": [
                  "client_id",
                  "client_secret",
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access token retrieved successfully"
          },
          "400": {
            "description": "Bad Request - Invalid Exchange Parameters"
          }
        }
      }
    },
    "/user/repos": {
      "get": {
        "operationId": "listRepositories",
        "summary": "List Repositories",
        "responses": {
          "200": {
            "description": "List of repositories returned successfully"
          },
          "401": {
            "description": "Unauthorized - Invalid Access Token"
          }
        }
      },
      "post": {
        "operationId": "createRepository",
        "summary": "Create Repository",
        "requestBody": {
          "description": "Details of the new repository",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the repository",
                    "example": "my-new-repository"
                  },
                  "private": {
                    "type": "boolean",
                    "description": "Whether the repository is private"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Repository created successfully"
          },
          "400": {
            "description": "Bad Request - Invalid Repository Parameters"
          }
        }
      }
    },
    "/repos/{owner}/{repo}": {
      "delete": {
        "operationId": "deleteRepository",
        "summary": "Delete Repository",
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "repo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Repository deleted successfully"
          },
          "404": {
            "description": "Not Found - Repository does not exist"
          }
        }
      }
    },
    "/user": {
      "get": {
        "operationId": "getUserProfile",
        "summary": "Get User Profile",
        "responses": {
          "200": {
            "description": "User profile information returned successfully"
          },
          "401": {
            "description": "Unauthorized - Invalid Access Token"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "Repository": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "private": {
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ]
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ]
}