Skip to content

Latest commit

 

History

History
107 lines (79 loc) · 1.84 KB

issue-endpoint.mdx

File metadata and controls

107 lines (79 loc) · 1.84 KB

Issue Endpoint

Endpoint

POST /api/issues

Creates a GitHub issue in the repository configured by environment variables.

Request Schema

{
  "title": "Issue title",
  "body": "Issue description",
  "reporter": "Application Name",
  "version": "1.0.0"
}

Validation Rules

  • title: required, string, maximum 120 characters.
  • body: required, string, maximum 10000 characters.
  • reporter: required, string, maximum 50 characters.
  • version: optional, string, maximum 50 characters.

Text input is trimmed and unsafe control characters are removed.

Example Request

curl -X POST https://example.vercel.app/api/issues \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Crash when opening launcher",
    "body": "The launcher closes after clicking Start.",
    "reporter": "ORB Launcher",
    "version": "1.0.0"
  }'

Success Response

{
  "success": true
}

Error Response

{
  "success": false,
  "error": "title is required"
}

Internal Processing Flow

sequenceDiagram
  participant Client
  participant Route as /api/issues
  participant Service as GitHubIssueService
  participant Validator
  participant Octokit
  participant GitHub

  Client->>Route: POST JSON
  Route->>Route: Parse JSON
  Route->>Service: createIssue(payload)
  Service->>Validator: validateCreateIssueRequest(payload)
  Validator-->>Service: typed issue data
  Service->>Service: format GitHub issue
  Service->>Octokit: issues.create()
  Octokit->>GitHub: Create issue
  GitHub-->>Octokit: Created issue
  Service-->>Route: { success: true }
  Route-->>Client: JSON response
Loading

Issue Formatting

GitHub issue title:

[Issue Reporter] {title}

GitHub issue body:

## Report Information

Reporter: {reporter}

Version: {version}

---

{body}

---

Submitted through ORB API.