{"openapi":"3.0.3","info":{"title":"gitarena","description":"Software development platform with built-in vcs, issue tracking and code review","contact":{"name":"Mari","email":"me@mari.zip"},"license":{"name":"MIT"},"version":"0.0.0"},"paths":{"/api":{"get":{"tags":["api"],"operationId":"api","responses":{"200":{"description":"API information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiInfoResponse"}}}}}}},"/api/admin/audit-log":{"get":{"tags":["admin"],"operationId":"get_admin_audit_log","parameters":[{"name":"offset","in":"query","description":"Pagination offset","required":false,"schema":{"type":"integer","format":"int64","nullable":true}},{"name":"limit","in":"query","description":"Maximum number of results (max 100, default 20)","required":false,"schema":{"type":"integer","format":"int64","nullable":true}},{"name":"type","in":"query","description":"Filter by event type","required":false,"schema":{"type":"string","nullable":true}},{"name":"class","in":"query","description":"Filter by class: security, activity, system","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Global audit log","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EventResponse"}}}}},"401":{"description":"Authentication required"},"403":{"description":"Admin required"}},"security":[{"cookieAuth":[]}]}},"/api/admin/health":{"get":{"tags":["admin"],"operationId":"get_instance_health","responses":{"201":{"description":"Instance health","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceHealth"}}}},"401":{"description":"Authentication required"},"403":{"description":"Admin required"}},"security":[{"cookieAuth":[]}]}},"/api/admin/stats":{"get":{"tags":["admin"],"operationId":"get_instance_stats","responses":{"201":{"description":"Instance stats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceStats"}}}},"401":{"description":"Authentication required"},"403":{"description":"Admin required"}},"security":[{"cookieAuth":[]}]}},"/api/admin/users":{"get":{"tags":["admin"],"operationId":"get_instance_users","responses":{"201":{"description":"Instance users","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExtendedUser"}}}}},"400":{"description":"Invalid query strings"},"401":{"description":"Authentication required"},"403":{"description":"Admin required"}},"security":[{"cookieAuth":[]}]}},"/api/auth/login":{"post":{"tags":["user"],"operationId":"post_login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginJsonRequest"}}},"required":true},"responses":{"200":{"description":"Login successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"400":{"description":"Empty identifier or password"},"401":{"description":"Invalid credentials or SSO account"},"403":{"description":"Account disabled"},"409":{"description":"Already logged in"}}}},"/api/auth/logout":{"post":{"tags":["user"],"operationId":"post_logout","responses":{"204":{"description":"Logged out successfully"},"401":{"description":"Not logged in"}},"security":[{"cookieAuth":[]}]}},"/api/auth/me":{"get":{"tags":["user"],"operationId":"get_me","responses":{"200":{"description":"Currently authenticated user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"401":{"description":"Not authenticated"}},"security":[{"cookieAuth":[]}]}},"/api/avatar":{"post":{"tags":["user"],"operationId":"put_avatar","responses":{"200":{"description":"Avatar upload URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadAvatarResponse"}}}},"401":{"description":"Authentication required"},"403":{"description":"User disabled"},"503":{"description":"Object storage unavailable"}},"security":[{"cookieAuth":[]}]},"delete":{"tags":["user"],"operationId":"delete_avatar","responses":{"204":{"description":"Avatar deleted"},"401":{"description":"Authentication required"},"403":{"description":"User disabled"},"503":{"description":"Object storage unavailable"}},"security":[{"cookieAuth":[]}]}},"/api/avatar/{user_id}":{"get":{"tags":["user"],"operationId":"get_avatar","parameters":[{"name":"user_id","in":"path","description":"User ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"User avatar"},"404":{"description":"User or avatar not found"},"503":{"description":"Object storage unavailable"}}}},"/api/explore":{"get":{"tags":["explore"],"operationId":"explore","parameters":[{"name":"sort","in":"query","description":"Sort order","required":false,"schema":{"type":"string","nullable":true}},{"name":"archived","in":"query","description":"Include archived repositories","required":false,"schema":{"type":"integer","format":"int32","nullable":true,"minimum":0}},{"name":"fork","in":"query","description":"Include forked repositories","required":false,"schema":{"type":"integer","format":"int32","nullable":true,"minimum":0}},{"name":"mirror","in":"query","description":"Include mirrored repositories","required":false,"schema":{"type":"integer","format":"int32","nullable":true,"minimum":0}},{"name":"offset","in":"query","description":"Pagination offset","required":false,"schema":{"type":"integer","format":"int32","nullable":true,"minimum":0}}],"responses":{"200":{"description":"List of repositories","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExploreResponse"}}}},"400":{"description":"Invalid sort order"}},"security":[{},{"cookieAuth":[]}]}},"/api/orgs":{"post":{"tags":["organization"],"operationId":"create_org","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrgRequest"}}},"required":true},"responses":{"200":{"description":"Organization created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Invalid organization name"},"401":{"description":"Authentication required"},"409":{"description":"Name already in use"}},"security":[{"cookieAuth":[]}]}},"/api/orgs/{name}":{"get":{"tags":["organization"],"operationId":"get_org","parameters":[{"name":"name","in":"path","description":"Organization name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Organization info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"404":{"description":"Organization not found"}}},"delete":{"tags":["organization"],"operationId":"delete_org","parameters":[{"name":"name","in":"path","description":"Organization name","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Organization deleted"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Organization not found"}},"security":[{"cookieAuth":[]}]}},"/api/orgs/{name}/audit-log":{"get":{"tags":["organization"],"operationId":"get_org_audit_log","parameters":[{"name":"name","in":"path","description":"Organization name","required":true,"schema":{"type":"string"}},{"name":"offset","in":"query","description":"Pagination offset","required":false,"schema":{"type":"integer","format":"int64","nullable":true}},{"name":"limit","in":"query","description":"Maximum number of results (max 100, default 20)","required":false,"schema":{"type":"integer","format":"int64","nullable":true}},{"name":"type","in":"query","description":"Filter by event type","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Organization audit log","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EventResponse"}}}}},"401":{"description":"Authentication required"},"403":{"description":"Admin or owner role required"},"404":{"description":"Organization not found"}},"security":[{"cookieAuth":[]}]}},"/api/orgs/{name}/members":{"get":{"tags":["organization"],"operationId":"list_members","parameters":[{"name":"name","in":"path","description":"Organization name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of members","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrgMemberEntry"}}}}},"404":{"description":"Organization not found"}}},"put":{"tags":["organization"],"operationId":"add_member","parameters":[{"name":"name","in":"path","description":"Organization name","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddMemberRequest"}}},"required":true},"responses":{"204":{"description":"Member added or updated"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Organization or user not found"}},"security":[{"cookieAuth":[]}]}},"/api/orgs/{name}/members/{username}":{"delete":{"tags":["organization"],"operationId":"remove_member","parameters":[{"name":"name","in":"path","description":"Organization name","required":true,"schema":{"type":"string"}},{"name":"username","in":"path","description":"Username to remove","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Member removed"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Organization or user not found"}},"security":[{"cookieAuth":[]}]}},"/api/repo":{"post":{"tags":["repository"],"operationId":"create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJsonRequest"}}},"required":true},"responses":{"200":{"description":"Repository created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJsonResponse"}}}},"400":{"description":"Invalid repository name or description"},"401":{"description":"Authentication required"},"409":{"description":"Repository name already in use"}},"security":[{"cookieAuth":[]}]}},"/api/repo/import":{"post":{"tags":["repository"],"operationId":"import","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportJsonRequest"}}},"required":true},"responses":{"200":{"description":"Repository import queued successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJsonResponse"}}}},"400":{"description":"Invalid repository name, description, or import URL"},"401":{"description":"Authentication required"},"409":{"description":"Repository name already in use"},"501":{"description":"Importing is disabled on this instance"}},"security":[{"cookieAuth":[]}]}},"/api/repo/{namespace}/{repository}/fork":{"post":{"tags":["repository"],"operationId":"create_fork","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForkJsonRequest"}}},"required":true},"responses":{"200":{"description":"Fork created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJsonResponse"}}}},"400":{"description":"Cannot fork into this namespace"},"401":{"description":"Authentication required"},"404":{"description":"Repository not found or access denied"},"409":{"description":"Repository name already in use in this namespace"}},"security":[{"cookieAuth":[]}]}},"/api/repo/{namespace}/{repository}/star":{"post":{"tags":["repository"],"operationId":"post_star","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Star added successfully"},"401":{"description":"Authentication required"},"404":{"description":"Repository not found or access denied"},"409":{"description":"Repository already starred"}},"security":[{"cookieAuth":[]}]},"delete":{"tags":["repository"],"operationId":"delete_star","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Star removed successfully"},"401":{"description":"Authentication required"},"404":{"description":"Repository not found or access denied"},"409":{"description":"Repository was not starred"}},"security":[{"cookieAuth":[]}]}},"/api/repo/{namespace}/{repository}/tree/{tree}/readme":{"get":{"tags":["repository"],"operationId":"readme","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"tree","in":"path","description":"Branch or tag name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Readme file name and content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadmeResponse"}}}},"404":{"description":"Repository, branch, or readme not found"}},"security":[{},{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}":{"get":{"tags":["repository"],"operationId":"meta","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Repository metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepoMetaResponse"}}}},"404":{"description":"Repository not found or access denied"}},"security":[{},{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/archive":{"patch":{"tags":["repository"],"operationId":"toggle_archive","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveRequest"}}},"required":true},"responses":{"204":{"description":"Archive status updated"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Repository not found or access denied"}},"security":[{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/branch/{tree}/blame/{file_path}":{"get":{"tags":["repository"],"operationId":"blame","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"tree","in":"path","description":"Branch name or full ref","required":true,"schema":{"type":"string"}},{"name":"file_path","in":"path","description":"File path relative to the repository root","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Blame hunks for the file","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlameResponse"}}}},"404":{"description":"Repository, branch, or file not found"}},"security":[{},{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/branch/{tree}/files":{"get":{"tags":["repository"],"operationId":"branch_files","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"tree","in":"path","description":"Branch name (short form like 'main', or full ref like 'refs/heads/main')","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Recursive file listing with last commit info for each entry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchFilesResponse"}}}},"404":{"description":"Repository or branch not found"}},"security":[{},{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/collaborators":{"get":{"tags":["repository"],"operationId":"list_collaborators","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of collaborators","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CollaboratorResponse"}}}}},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Repository not found or access denied"}},"security":[{"cookieAuth":[]}]},"put":{"tags":["repository"],"operationId":"upsert_collaborator","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertCollaboratorRequest"}}},"required":true},"responses":{"200":{"description":"Collaborator added or updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollaboratorResponse"}}}},"400":{"description":"Invalid request or cannot modify repo owner"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Repository or target user not found"}},"security":[{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/collaborators/{username}":{"delete":{"tags":["repository"],"operationId":"remove_collaborator","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"username","in":"path","description":"Username of the collaborator to remove","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Collaborator removed"},"400":{"description":"Cannot remove the repository owner"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Repository or collaborator not found"}},"security":[{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/commits/{oid}":{"get":{"tags":["repository"],"operationId":"commit_detail","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"oid","in":"path","description":"Full or abbreviated commit SHA-1","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Commit detail with structured diff","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitDetailResponse"}}}},"400":{"description":"Invalid OID"},"404":{"description":"Repository or commit not found"}},"security":[{},{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/issues/{index}/timeline":{"get":{"tags":["issues"],"operationId":"get_issue_timeline","parameters":[{"name":"namespace","in":"path","description":"Repository namespace","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"index","in":"path","description":"Issue number","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Issue timeline events","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TimelineEvent"}}}}},"404":{"description":"Issue not found"}},"security":[{},{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/labels":{"get":{"tags":["issues"],"operationId":"list_labels","parameters":[{"name":"namespace","in":"path","description":"Repository namespace","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of labels","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelsResponse"}}}},"404":{"description":"Repository not found or access denied"}},"security":[{},{"cookieAuth":[]}]},"post":{"tags":["issues"],"operationId":"create_label","parameters":[{"name":"namespace","in":"path","description":"Repository namespace","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLabelRequest"}}},"required":true},"responses":{"200":{"description":"Label created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelEntry"}}}},"400":{"description":"Invalid request"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Repository not found or access denied"},"409":{"description":"Label name already exists"}},"security":[{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/labels/{label_id}":{"put":{"tags":["issues"],"operationId":"update_label","parameters":[{"name":"namespace","in":"path","description":"Repository namespace","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"label_id","in":"path","description":"Label UUID","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLabelRequest"}}},"required":true},"responses":{"200":{"description":"Label updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabelEntry"}}}},"400":{"description":"Invalid request"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Repository or label not found"},"409":{"description":"Label name already exists"}},"security":[{"cookieAuth":[]}]},"delete":{"tags":["issues"],"operationId":"delete_label","parameters":[{"name":"namespace","in":"path","description":"Repository namespace","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"label_id","in":"path","description":"Label UUID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Label deleted"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Repository or label not found"}},"security":[{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/milestones":{"get":{"tags":["issues"],"operationId":"list_milestones","parameters":[{"name":"namespace","in":"path","description":"Repository namespace","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of milestones","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MilestonesResponse"}}}},"404":{"description":"Repository not found or access denied"}},"security":[{},{"cookieAuth":[]}]},"post":{"tags":["issues"],"operationId":"create_milestone","parameters":[{"name":"namespace","in":"path","description":"Repository namespace","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMilestoneRequest"}}},"required":true},"responses":{"200":{"description":"Milestone created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MilestoneEntry"}}}},"400":{"description":"Invalid request"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Repository not found or access denied"}},"security":[{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/milestones/{milestone_id}":{"delete":{"tags":["issues"],"operationId":"delete_milestone","parameters":[{"name":"namespace","in":"path","description":"Repository namespace","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"milestone_id","in":"path","description":"Milestone UUID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Milestone deleted"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Repository or milestone not found"}},"security":[{"cookieAuth":[]}]},"patch":{"tags":["issues"],"operationId":"update_milestone","parameters":[{"name":"namespace","in":"path","description":"Repository namespace","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"milestone_id","in":"path","description":"Milestone UUID","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMilestoneRequest"}}},"required":true},"responses":{"200":{"description":"Milestone updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MilestoneEntry"}}}},"400":{"description":"Invalid request"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Repository or milestone not found"}},"security":[{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/permissions":{"get":{"tags":["repository"],"operationId":"get_permissions","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Permission map for the current user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionsResponse"}}}},"404":{"description":"Repository not found or access denied"}},"security":[{},{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/releases":{"get":{"tags":["repository"],"operationId":"list_releases","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of releases","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReleaseResponse"}}}}},"404":{"description":"Repository not found or access denied"}},"security":[{},{"cookieAuth":[]}]},"post":{"tags":["repository"],"operationId":"create_release","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReleaseRequest"}}},"required":true},"responses":{"200":{"description":"Created release","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseResponse"}}}},"400":{"description":"Bad request"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"}},"security":[{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/releases/latest":{"get":{"tags":["repository"],"operationId":"latest_release","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Latest non-pre-release","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseResponse"}}}},"404":{"description":"No release found"}},"security":[{},{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/releases/{release_id}":{"get":{"tags":["repository"],"operationId":"get_release","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"release_id","in":"path","description":"Release ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Release details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseResponse"}}}},"404":{"description":"Release not found"}},"security":[{},{"cookieAuth":[]}]},"delete":{"tags":["repository"],"operationId":"delete_release","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"release_id","in":"path","description":"Release ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Release deleted"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Release not found"}},"security":[{"cookieAuth":[]}]},"patch":{"tags":["repository"],"operationId":"update_release","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"release_id","in":"path","description":"Release ID","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateReleaseRequest"}}},"required":true},"responses":{"200":{"description":"Updated release","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseResponse"}}}},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Release not found"}},"security":[{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/releases/{release_id}/assets":{"post":{"tags":["repository"],"operationId":"create_asset","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"release_id","in":"path","description":"Release ID","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAssetRequest"}}},"required":true},"responses":{"200":{"description":"Asset created with upload URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAssetResponse"}}}},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Release not found"},"503":{"description":"Object storage not available"}},"security":[{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/releases/{release_id}/assets/{asset_id}":{"delete":{"tags":["repository"],"operationId":"delete_asset","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"release_id","in":"path","description":"Release ID","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"asset_id","in":"path","description":"Asset ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Asset deleted"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Asset not found"},"503":{"description":"Object storage not available"}},"security":[{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/releases/{release_id}/assets/{asset_id}/confirm":{"put":{"tags":["repository"],"operationId":"confirm_asset","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"release_id","in":"path","description":"Release ID","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"asset_id","in":"path","description":"Asset ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Asset confirmed and available"},"400":{"description":"Asset not yet uploaded to object storage"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions"},"404":{"description":"Asset not found"},"503":{"description":"Object storage not available"}},"security":[{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/releases/{release_id}/assets/{asset_id}/download":{"get":{"tags":["repository"],"operationId":"download_asset","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"release_id","in":"path","description":"Release ID","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"asset_id","in":"path","description":"Asset ID","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"302":{"description":"Redirect to presigned download URL"},"404":{"description":"Asset not found or not yet available"},"503":{"description":"Object storage not available"}},"security":[{},{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/stats":{"get":{"tags":["repository"],"operationId":"get_stats","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Statistics about the repository","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepoStatsStarsResponse"}}}},"404":{"description":"Repository not found or access denied"}},"security":[{},{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/tags":{"get":{"tags":["repository"],"operationId":"list_tags","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of tags","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagsResponse"}}}},"404":{"description":"Repository not found or access denied"}},"security":[{},{"cookieAuth":[]}]}},"/api/repos/{namespace}/{repository}/tags/{tag}":{"delete":{"tags":["repository"],"operationId":"delete_tag","parameters":[{"name":"namespace","in":"path","description":"Repository namespace (user or organization)","required":true,"schema":{"type":"string"}},{"name":"repository","in":"path","description":"Repository name","required":true,"schema":{"type":"string"}},{"name":"tag","in":"path","description":"Tag name to delete","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Tag deleted"},"401":{"description":"Authentication required"},"403":{"description":"Insufficient permissions or repository is archived"},"404":{"description":"Repository or tag not found"}},"security":[{"cookieAuth":[]}]}},"/api/search/code":{"get":{"tags":["search"],"operationId":"get_code_search","parameters":[{"name":"query","in":"query","description":"Zoekt query string","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Maximum number of files to return","required":false,"schema":{"type":"integer","format":"int32","nullable":true}}],"responses":{"200":{"description":"Code search results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeSearchResponse"}}}},"400":{"description":"Invalid search query"},"501":{"description":"Code search disabled"},"502":{"description":"Code search backend unavailable"}},"security":[{},{"cookieAuth":[]}]}},"/api/search/repositories":{"get":{"tags":["search"],"operationId":"get_repo_search","parameters":[{"name":"query","in":"query","description":"Search query string","required":true,"schema":{"type":"string"}},{"name":"offset","in":"query","description":"Pagination offset","required":false,"schema":{"type":"integer","format":"int32","nullable":true,"minimum":0}},{"name":"limit","in":"query","description":"Maximum number of results (max 100, default 20)","required":false,"schema":{"type":"integer","format":"int32","nullable":true,"minimum":0}}],"responses":{"200":{"description":"Repository search results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepoSearchResponse"}}}},"400":{"description":"Missing or invalid search query"},"501":{"description":"Search disabled"}},"security":[{},{"cookieAuth":[]}]}},"/api/search/users":{"get":{"tags":["search"],"operationId":"get_user_search","parameters":[{"name":"query","in":"query","description":"Search query string","required":true,"schema":{"type":"string"}},{"name":"offset","in":"query","description":"Pagination offset","required":false,"schema":{"type":"integer","format":"int32","nullable":true,"minimum":0}},{"name":"limit","in":"query","description":"Maximum number of results (max 100, default 20)","required":false,"schema":{"type":"integer","format":"int32","nullable":true,"minimum":0}}],"responses":{"200":{"description":"User search results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSearchResponse"}}}},"400":{"description":"Missing or invalid search query"},"501":{"description":"Search disabled"}},"security":[{},{"cookieAuth":[]}]}},"/api/ssh-key":{"put":{"tags":["user"],"operationId":"put_ssh_key","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddKeyJsonRequest"}}},"required":true},"responses":{"201":{"description":"SSH key added successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddKeyJsonResponse"}}}},"400":{"description":"Invalid or unsupported key, missing title"},"401":{"description":"Authentication required"},"409":{"description":"SSH key already exists"},"422":{"description":"Key fingerprint calculation failed"}},"security":[{"cookieAuth":[]}]}},"/api/sso":{"get":{"tags":["user"],"operationId":"get_sso_providers","responses":{"200":{"description":"Which SSO providers are enabled on this instance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SSOProvidersResponse"}}}}}}},"/api/users/me/assigned-issues":{"get":{"tags":["user"],"operationId":"get_assigned_issues","responses":{"200":{"description":"Issues assigned to the authenticated user","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssignedIssueEntry"}}}}},"401":{"description":"Authentication required"}},"security":[{"cookieAuth":[]}]}},"/api/users/me/audit-log":{"get":{"tags":["user"],"operationId":"get_personal_audit_log","parameters":[{"name":"offset","in":"query","description":"Pagination offset","required":false,"schema":{"type":"integer","format":"int64","nullable":true}},{"name":"limit","in":"query","description":"Maximum number of results (max 100, default 20)","required":false,"schema":{"type":"integer","format":"int64","nullable":true}},{"name":"type","in":"query","description":"Filter by event type","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Personal security audit log","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EventResponse"}}}}},"401":{"description":"Authentication required"}},"security":[{"cookieAuth":[]}]}},"/api/users/me/events":{"get":{"tags":["user"],"operationId":"get_dashboard_feed","parameters":[{"name":"offset","in":"query","description":"Pagination offset","required":false,"schema":{"type":"integer","format":"int64","nullable":true}},{"name":"limit","in":"query","description":"Maximum number of results (max 100, default 20)","required":false,"schema":{"type":"integer","format":"int64","nullable":true}},{"name":"type","in":"query","description":"Filter by event type","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Dashboard activity feed","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EventResponse"}}}}},"401":{"description":"Authentication required"}},"security":[{"cookieAuth":[]}]}},"/api/users/{username}":{"get":{"tags":["user"],"operationId":"get_user_profile","parameters":[{"name":"username","in":"path","description":"Username to look up","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"User profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileResponse"}}}},"404":{"description":"User not found"}},"security":[{},{"cookieAuth":[]}]}},"/api/users/{username}/contributions":{"get":{"tags":["user"],"operationId":"get_contributions","parameters":[{"name":"username","in":"path","description":"Username to look up","required":true,"schema":{"type":"string"}},{"name":"year","in":"query","description":"Year to query (defaults to last 365 days)","required":false,"schema":{"type":"integer","format":"int32","nullable":true}}],"responses":{"200":{"description":"Contribution graph data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContributionsResponse"}}}},"404":{"description":"User not found"}},"security":[{},{"cookieAuth":[]}]}},"/api/users/{username}/events":{"get":{"tags":["user"],"operationId":"get_user_feed","parameters":[{"name":"username","in":"path","description":"Username to look up","required":true,"schema":{"type":"string"}},{"name":"offset","in":"query","description":"Pagination offset","required":false,"schema":{"type":"integer","format":"int64","nullable":true}},{"name":"limit","in":"query","description":"Maximum number of results (max 100, default 20)","required":false,"schema":{"type":"integer","format":"int64","nullable":true}},{"name":"type","in":"query","description":"Filter by event type","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"User activity feed","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EventResponse"}}}}},"404":{"description":"User not found"}},"security":[{},{"cookieAuth":[]}]}}},"components":{"schemas":{"AccessLevel":{"type":"string","enum":["viewer","supporter","coder","manager","admin"]},"AddKeyJsonRequest":{"type":"object","required":["title","key"],"properties":{"expiration_date":{"type":"integer","format":"int64","description":"Optional expiration date as a Unix timestamp (seconds since epoch)","example":1735689600,"nullable":true},"key":{"type":"string","description":"Full OpenSSH public key string","minLength":1},"title":{"type":"string","description":"Display title for the key","minLength":1}}},"AddKeyJsonResponse":{"type":"object","required":["id","fingerprint"],"properties":{"fingerprint":{"type":"string","description":"MD5 fingerprint of the public key"},"id":{"type":"string","format":"uuid","description":"Internal ID of the newly added key"}}},"AddMemberRequest":{"type":"object","required":["username"],"properties":{"role":{"$ref":"#/components/schemas/OrgRole"},"username":{"type":"string","description":"Username of the user to add"}}},"ApiInfoResponse":{"type":"object","description":"General GitArena information","required":["app","version","baseUrl","documentation","repository","commit","objectStorageAvailable"],"properties":{"app":{"type":"string","description":"Application name"},"baseUrl":{"type":"string","description":"Base url of this instance"},"commit":{"type":"string","description":"Short git commit SHA of the running build"},"documentation":{"type":"string","description":"Link to the API documentation"},"objectStorageAvailable":{"type":"boolean","description":"Whether object storage is available"},"repository":{"type":"string","description":"Source repository URL"},"sshPort":{"type":"integer","format":"int32","description":"Port of the SSH server, if running","nullable":true},"version":{"type":"string","description":"Version"}}},"Arch":{"type":"string","enum":["x86_64","i686","aarch64","armv7","armv6","riscv64","loongarch64","powerpc64","s390x","wasm32","universal","unknown"]},"ArchiveRequest":{"type":"object","required":["archive"],"properties":{"archive":{"type":"boolean","description":"true archives the repo, false unarchives the repo"}}},"AssignedIssueEntry":{"type":"object","required":["id","index","title","status","priority","updatedAt","repoName","repoNamespace"],"properties":{"id":{"type":"string","format":"uuid"},"index":{"type":"integer","format":"int32"},"priority":{"type":"string"},"repoName":{"type":"string"},"repoNamespace":{"type":"string"},"status":{"$ref":"#/components/schemas/IssueStatus"},"title":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"}}},"BlameHunk":{"type":"object","required":["commitId","authorName","authorEmail","timestamp","summary","startLine","numLines"],"properties":{"authorEmail":{"type":"string"},"authorName":{"type":"string"},"authorUid":{"type":"string","format":"uuid","description":"GitArena user ID of the author, if matched","nullable":true},"commitId":{"type":"string"},"numLines":{"type":"integer","format":"int32","description":"Number of lines belonging to this hunk","minimum":0},"startLine":{"type":"integer","format":"int32","description":"1-indexed starting line number in the final file","minimum":0},"summary":{"type":"string"},"timestamp":{"type":"integer","format":"int64","description":"Unix timestamp of the commit"}}},"BlameResponse":{"type":"object","required":["hunks"],"properties":{"hunks":{"type":"array","items":{"$ref":"#/components/schemas/BlameHunk"}}}},"BranchFilesResponse":{"type":"object","required":["files","truncated"],"properties":{"files":{"type":"array","items":{"$ref":"#/components/schemas/FileEntry"},"description":"File entries, capped at 10'000"},"truncated":{"type":"boolean","description":"Whether the file listing was truncated due to exceeding the 10'000 entry limit"}}},"CodeSearchResponse":{"type":"object","required":["result"],"properties":{"result":{"$ref":"#/components/schemas/JsonValue"}}},"CollaboratorResponse":{"type":"object","required":["user_id","username","access_level"],"properties":{"access_level":{"$ref":"#/components/schemas/AccessLevel"},"user_id":{"type":"string","format":"uuid"},"username":{"type":"string"}}},"CommitDetailResponse":{"type":"object","required":["commit","stats","files"],"properties":{"branch":{"type":"string","description":"Short branch name that contains this commit, if any","nullable":true},"commit":{"$ref":"#/components/schemas/CommitMeta"},"files":{"type":"array","items":{"$ref":"#/components/schemas/DiffFile"}},"stats":{"$ref":"#/components/schemas/DiffStats"}}},"CommitMeta":{"type":"object","required":["oid","shortOid","message","author","committer","parents"],"properties":{"author":{"$ref":"#/components/schemas/SignatureInfo"},"committer":{"$ref":"#/components/schemas/SignatureInfo"},"description":{"type":"string","description":"Remainder of the commit message after the first blank line, if any","nullable":true},"message":{"type":"string","description":"First line of the commit message"},"oid":{"type":"string","description":"Full SHA-1 hex"},"parents":{"type":"array","items":{"type":"string"},"description":"Parent commit OIDs (full SHA-1 hex)"},"shortOid":{"type":"string","description":"Abbreviated SHA-1 hex (7 chars)"}}},"ComponentStatus":{"oneOf":[{"type":"string","enum":["healthy"]},{"type":"object","required":["degraded"],"properties":{"degraded":{"type":"string"}}},{"type":"string","enum":["unhealthy"]},{"type":"string","enum":["disabled"]}]},"ContributionDay":{"type":"object","required":["date","count"],"properties":{"count":{"type":"integer","format":"int32"},"date":{"type":"string"}}},"ContributionsResponse":{"type":"object","required":["contributions"],"properties":{"contributions":{"type":"array","items":{"$ref":"#/components/schemas/ContributionDay"}}}},"CreateAssetRequest":{"type":"object","required":["name","size"],"properties":{"arch":{"allOf":[{"$ref":"#/components/schemas/Arch"}],"nullable":true},"kind":{"allOf":[{"$ref":"#/components/schemas/Kind"}],"nullable":true},"libc":{"allOf":[{"$ref":"#/components/schemas/Libc"}],"nullable":true},"name":{"type":"string"},"os":{"allOf":[{"$ref":"#/components/schemas/Os"}],"nullable":true},"size":{"type":"integer","format":"int64"}}},"CreateAssetResponse":{"type":"object","required":["assetId","uploadUrl"],"properties":{"assetId":{"type":"string","format":"uuid"},"uploadUrl":{"type":"string"}}},"CreateJsonRequest":{"type":"object","required":["namespace","name","description","visibility","defaultBranch"],"properties":{"defaultBranch":{"type":"string","description":"Default branch for repository"},"description":{"type":"string","description":"Short description of the repository","maxLength":256},"gitignore":{"type":"string","description":"Optional: initialize a .gitignore file with the chosen template","nullable":true},"license":{"type":"string","description":"Optional: initialioze a LICENSE.txt file with the chosen license","nullable":true},"name":{"type":"string","description":"Repository name","maxLength":32,"pattern":"^[a-z0-9_-]+$"},"namespace":{"type":"string","description":"Namespace (username or org name) under which the repo should be created"},"readme":{"type":"boolean","description":"Optional: initialise a README.md with the repo name and description","nullable":true},"visibility":{"$ref":"#/components/schemas/RepoVisibility"}}},"CreateJsonResponse":{"type":"object","required":["id","url"],"properties":{"id":{"type":"string","format":"uuid","description":"Internal ID of the newly created repository"},"url":{"type":"string","description":"Full URL to the repository"}}},"CreateLabelRequest":{"type":"object","required":["name","color"],"properties":{"color":{"type":"string","description":"Hex color (e.g. `#ff0000`)"},"description":{"type":"string","description":"Optional description","nullable":true},"name":{"type":"string","description":"Label name (use `scope::value` for scoped labels)"}}},"CreateMilestoneRequest":{"type":"object","required":["title"],"properties":{"description":{"type":"string","description":"Description","nullable":true},"dueDate":{"type":"string","format":"date-time","description":"Due date","nullable":true},"title":{"type":"string","description":"Title"}}},"CreateOrgRequest":{"type":"object","required":["name"],"properties":{"description":{"type":"string","description":"Description"},"name":{"type":"string","description":"Name","maxLength":32,"pattern":"^[a-z0-9_-]+$"}}},"CreateReleaseRequest":{"type":"object","required":["tag","title"],"properties":{"description":{"type":"string","nullable":true},"preRelease":{"type":"boolean","nullable":true},"tag":{"type":"string"},"title":{"type":"string"}}},"DiffFile":{"type":"object","required":["status","path","binary","tooLarge","stats","hunks"],"properties":{"binary":{"type":"boolean","description":"Whether the file is binary (hunks will be empty)"},"hunks":{"type":"array","items":{"$ref":"#/components/schemas/DiffHunk"},"description":"Diff hunks (empty for binary or too-large files)"},"oldPath":{"type":"string","description":"Old path, only present for renames and copies","nullable":true},"path":{"type":"string","description":"New path of the file (or only path for non-renames)"},"stats":{"$ref":"#/components/schemas/FileStats"},"status":{"$ref":"#/components/schemas/DiffStatus"},"tooLarge":{"type":"boolean","description":"Whether the file was truncated due to exceeding the line cap (hunks will be empty)"}}},"DiffHunk":{"type":"object","required":["header","oldStart","oldLines","newStart","newLines","lines"],"properties":{"header":{"type":"string","description":"Hunk header line (e.g. \"@@ -12,7 +12,9 @@ impl Cloner {\")"},"lines":{"type":"array","items":{"$ref":"#/components/schemas/DiffLineEntry"},"description":"Lines in this hunk"},"newLines":{"type":"integer","format":"int32","description":"Number of lines in the new file","minimum":0},"newStart":{"type":"integer","format":"int32","description":"Starting line number in the new file","minimum":0},"oldLines":{"type":"integer","format":"int32","description":"Number of lines in the old file","minimum":0},"oldStart":{"type":"integer","format":"int32","description":"Starting line number in the old file","minimum":0}}},"DiffLineEntry":{"type":"object","required":["kind","content"],"properties":{"content":{"type":"string","description":"Line content without the leading +/-/space character"},"kind":{"$ref":"#/components/schemas/DiffLineKind"},"newLineNumber":{"type":"integer","format":"int32","description":"Line number in the new file (null for deletions)","nullable":true,"minimum":0},"oldLineNumber":{"type":"integer","format":"int32","description":"Line number in the old file (null for additions)","nullable":true,"minimum":0}}},"DiffLineKind":{"type":"string","enum":["context","addition","deletion"]},"DiffStats":{"type":"object","required":["filesChanged","insertions","deletions"],"properties":{"deletions":{"type":"integer","description":"Total lines deleted","minimum":0},"filesChanged":{"type":"integer","description":"Number of files changed","minimum":0},"insertions":{"type":"integer","description":"Total lines added","minimum":0}}},"DiffStatus":{"type":"string","enum":["added","deleted","modified","renamed","copied","untracked"]},"EventResponse":{"allOf":[{"$ref":"#/components/schemas/Event"},{"type":"object","properties":{"actorUsername":{"type":"string","nullable":true},"subjectName":{"type":"string","nullable":true},"subjectNamespace":{"type":"string","nullable":true}}}]},"ExploreRepo":{"type":"object","required":["id","name","description","ownerId","ownerName","visibility","disabled","languages","stars","issues","mergeRequests"],"properties":{"archivedAt":{"type":"string","format":"date-time","nullable":true},"description":{"type":"string"},"disabled":{"type":"boolean"},"id":{"type":"string","format":"uuid"},"issues":{"type":"integer","format":"int64"},"languages":{"$ref":"#/components/schemas/JsonValue"},"mergeRequests":{"type":"integer","format":"int64"},"name":{"type":"string"},"ownerId":{"type":"string","format":"uuid"},"ownerName":{"type":"string"},"stars":{"type":"integer","format":"int64"},"visibility":{"$ref":"#/components/schemas/RepoVisibility"}}},"ExploreResponse":{"type":"object","required":["repositories"],"properties":{"repositories":{"type":"array","items":{"$ref":"#/components/schemas/ExploreRepo"}}}},"ExtendedUser":{"allOf":[{"$ref":"#/components/schemas/User"},{"type":"object","required":["email"],"properties":{"email":{"type":"string"},"verifiedAt":{"type":"string","format":"date-time","nullable":true}}}]},"FileCommitInfo":{"allOf":[{"type":"object","required":["message","time","authorName","authorEmail"],"properties":{"authorEmail":{"type":"string","description":"Author email address"},"authorName":{"type":"string","description":"Author display name"},"authorUid":{"type":"string","format":"uuid","description":"GitArena user ID of the author","nullable":true},"message":{"type":"string","description":"Commit message"},"time":{"type":"integer","format":"int64","description":"Unix timestamp of the commit"}}},{"type":"object","required":["sha1"],"properties":{"sha1":{"type":"string","description":"SHA1 hash of the commit"}}}]},"FileEntry":{"type":"object","required":["fileType","fileName","commit"],"properties":{"commit":{"$ref":"#/components/schemas/FileCommitInfo"},"fileName":{"type":"string","description":"Full path of the entry relative to the repository root"},"fileType":{"$ref":"#/components/schemas/FileType"},"submoduleTargetOid":{"type":"string","description":"Target commit OID for submodule entries","nullable":true}}},"FileStats":{"type":"object","required":["insertions","deletions"],"properties":{"deletions":{"type":"integer","description":"Lines deleted in this file","minimum":0},"insertions":{"type":"integer","description":"Lines added in this file","minimum":0}}},"FileType":{"type":"string","enum":["tree","blob","blobExecutable","link","commit"]},"ImportJsonRequest":{"type":"object","required":["namespace","name","description","url","visibility"],"properties":{"description":{"type":"string","description":"Short description of the repository","maxLength":256},"mirror":{"type":"boolean","description":"Set to true to mirror the repository","nullable":true},"name":{"type":"string","description":"Repository name","maxLength":32,"pattern":"^[a-z0-9_-]+$"},"namespace":{"type":"string","description":"Namespace (username or org name) under which the imported repo should be created"},"password":{"type":"string","description":"Password for authenticating with the remote","nullable":true},"url":{"type":"string","format":"uri","description":"URL of the remote repository to import"},"username":{"type":"string","description":"Username for authenticating with the remote","nullable":true},"visibility":{"$ref":"#/components/schemas/RepoVisibility"}}},"InstanceComponent":{"type":"object","required":["name","status"],"properties":{"latency":{"type":"integer","format":"int64","description":"Latency in ms","nullable":true,"minimum":0},"name":{"type":"string","description":"Name"},"status":{"$ref":"#/components/schemas/ComponentStatus"}}},"InstanceHealth":{"type":"object","required":["components"],"properties":{"components":{"type":"array","items":{"$ref":"#/components/schemas/InstanceComponent"}}}},"InstanceStats":{"type":"object","required":["users","orgs","repositories","totalSpace","usedSpace"],"properties":{"orgs":{"type":"integer","format":"int64","description":"Organization amount"},"repositories":{"type":"integer","format":"int64","description":"Repository amount"},"totalSpace":{"type":"integer","format":"int64","description":"Total disk space in bytes for repositories directory","minimum":0},"usedSpace":{"type":"integer","format":"int64","description":"Used disk space in bytes for repositories directory","minimum":0},"users":{"type":"integer","format":"int64","description":"User amount"}}},"IssueStatus":{"type":"string","enum":["open","in_progress","completed","not_planned"]},"Kind":{"type":"string","enum":["binary","installer","library","source","sbom","other"]},"LabelEntry":{"type":"object","required":["id","name","color"],"properties":{"color":{"type":"string"},"description":{"type":"string","nullable":true},"id":{"type":"string","format":"uuid"},"name":{"type":"string"}}},"LabelsResponse":{"type":"object","required":["labels"],"properties":{"labels":{"type":"array","items":{"$ref":"#/components/schemas/LabelEntry"}}}},"Libc":{"type":"string","enum":["gnu","musl","msvc","mingw","bionic","unknown"]},"LoginJsonRequest":{"type":"object","required":["identifier","password"],"properties":{"identifier":{"type":"string","description":"Username or email address"},"password":{"type":"string"}}},"MeResponse":{"type":"object","required":["id","username","admin"],"properties":{"admin":{"type":"boolean"},"id":{"type":"string","format":"uuid"},"username":{"type":"string"}}},"MilestoneEntry":{"type":"object","required":["id","title","closed","openIssues","closedIssues"],"properties":{"closed":{"type":"boolean","description":"Whether milestone is closed"},"closedIssues":{"type":"integer","format":"int64","description":"Amount of closed issues (completed, not planned)"},"description":{"type":"string","description":"Description","nullable":true},"dueDate":{"type":"string","format":"date-time","description":"Due date","nullable":true},"id":{"type":"string","format":"uuid","description":"ID"},"openIssues":{"type":"integer","format":"int64","description":"Amount of open issues (open, in progress)"},"title":{"type":"string","description":"Title"}}},"MilestonesResponse":{"type":"object","required":["milestones"],"properties":{"milestones":{"type":"array","items":{"$ref":"#/components/schemas/MilestoneEntry"}}}},"OrgMember":{"type":"object","required":["org_id","user_id","role"],"properties":{"org_id":{"type":"string","format":"uuid","description":"Organization ID"},"role":{"$ref":"#/components/schemas/OrgRole"},"user_id":{"type":"string","format":"uuid","description":"User ID"}}},"OrgMemberEntry":{"type":"object","required":["userId","role"],"properties":{"role":{"$ref":"#/components/schemas/OrgRole"},"userId":{"type":"string","format":"uuid","description":"User ID"}}},"OrgRole":{"type":"string","enum":["owner","admin","member"]},"Organization":{"type":"object","required":["id","name","description"],"properties":{"description":{"type":"string","description":"Description"},"id":{"type":"string","format":"uuid","description":"ID"},"name":{"type":"string","description":"Name"}}},"Os":{"type":"string","enum":["linux","windows","macos","freebsd","openbsd","netbsd","android","ios","unknown"]},"PermissionsResponse":{"type":"object","required":["permissions"],"properties":{"permissions":{"$ref":"#/components/schemas/RepoPermissions"}}},"ReadmeResponse":{"type":"object","description":"Readme file name and rendered content","required":["file_name","content"],"properties":{"content":{"type":"string","description":"Raw text content of the readme file"},"file_name":{"type":"string","description":"File name of the readme"}}},"ReleaseAssets":{"type":"object","required":["id","releaseId","name","size","hash","available","downloads"],"properties":{"arch":{"allOf":[{"$ref":"#/components/schemas/Arch"}],"nullable":true},"available":{"type":"boolean"},"downloads":{"type":"integer","format":"int64"},"hash":{"type":"string"},"id":{"type":"string","format":"uuid"},"kind":{"allOf":[{"$ref":"#/components/schemas/Kind"}],"nullable":true},"libc":{"allOf":[{"$ref":"#/components/schemas/Libc"}],"nullable":true},"name":{"type":"string"},"os":{"allOf":[{"$ref":"#/components/schemas/Os"}],"nullable":true},"releaseId":{"type":"string","format":"uuid"},"size":{"type":"integer","format":"int64"}}},"ReleaseResponse":{"allOf":[{"$ref":"#/components/schemas/Release"},{"type":"object","required":["latest","assets"],"properties":{"assets":{"type":"array","items":{"$ref":"#/components/schemas/ReleaseAssets"}},"commit":{"type":"string","nullable":true},"commitMessage":{"type":"string","nullable":true},"latest":{"type":"boolean"}}}]},"RepoPermissions":{"type":"object","required":["view","push","manageIssues","admin"],"properties":{"admin":{"type":"boolean"},"manageIssues":{"type":"boolean"},"push":{"type":"boolean"},"view":{"type":"boolean"}}},"RepoSearchResponse":{"type":"object","required":["total","repositories"],"properties":{"repositories":{"type":"array","items":{"$ref":"#/components/schemas/ExploreRepo"}},"total":{"type":"integer","format":"int64","minimum":0}}},"RepoStatsDetailResponse":{"type":"object","description":"Details about a statistic like Stars, Forks or Watchers","required":["count","self"],"properties":{"count":{"type":"integer","format":"int64","description":"Total number"},"self":{"type":"boolean","description":"Whether the authenticated user has itself has given it for the repository"}}},"RepoStatsStarsResponse":{"type":"object","description":"Statistics for a repository","required":["size","stars","forks","watchers"],"properties":{"forks":{"$ref":"#/components/schemas/RepoStatsDetailResponse"},"size":{"type":"integer","format":"int64","description":"Size of the repository in bytes","minimum":0},"stars":{"$ref":"#/components/schemas/RepoStatsDetailResponse"},"watchers":{"$ref":"#/components/schemas/RepoStatsDetailResponse"}}},"RepoVisibility":{"type":"string","enum":["public","internal","private"]},"Repository":{"type":"object","required":["id","name","description","visibility","defaultBranch","languages","disabled"],"properties":{"archivedAt":{"type":"string","format":"date-time","description":"Timestamp when the repository was archived","nullable":true},"defaultBranch":{"type":"string","description":"Default branch"},"description":{"type":"string","description":"Description, set by the user"},"disabled":{"type":"boolean","description":"Disabled flag"},"forkedFrom":{"type":"string","format":"uuid","description":"ID of the repo from which this one was forked from","nullable":true},"id":{"type":"string","format":"uuid","description":"ID"},"languages":{"type":"object","description":"Auto-detected programming language stats of the main branch in the format of (Language, Byte count).\nCaveat: SVG files are the amount of files instead of the total byte count to avoid skewing repository stats","additionalProperties":{"type":"integer","format":"int64","minimum":0}},"license":{"type":"string","description":"Auto-detected license name","nullable":true},"mirroredFrom":{"type":"string","description":"URL of the repo from which this one is mirrored from","nullable":true},"name":{"type":"string","description":"Name of the repository"},"ownerOrg":{"type":"string","format":"uuid","description":"UUID of the organization that owns this repository","nullable":true},"ownerUser":{"type":"string","format":"uuid","description":"UUID of the user who owns this repository","nullable":true},"visibility":{"$ref":"#/components/schemas/RepoVisibility"}}},"SSOProvidersResponse":{"type":"object","description":"Whether the specific SSO methods are enabled","required":["github","gitlab","bitbucket"],"properties":{"bitbucket":{"type":"boolean"},"github":{"type":"boolean"},"gitlab":{"type":"boolean"}}},"SearchUser":{"type":"object","required":["id","username","admin"],"properties":{"admin":{"type":"boolean"},"id":{"type":"string","format":"uuid"},"username":{"type":"string"}}},"SignatureInfo":{"type":"object","required":["name","email","timestamp"],"properties":{"email":{"type":"string","description":"Email address"},"name":{"type":"string","description":"Display name"},"timestamp":{"type":"integer","format":"int64","description":"Unix timestamp"},"uid":{"type":"string","format":"uuid","description":"GitArena user ID, if the email matches a registered user","nullable":true}}},"TagInfo":{"type":"object","required":["name","commit","commitMessage","author","date","kind"],"properties":{"author":{"$ref":"#/components/schemas/SignatureInfo"},"commit":{"type":"string","description":"Commit SHA"},"commitMessage":{"type":"string","description":"First line of the commit message"},"date":{"type":"string","format":"date-time","description":"Timestamp"},"kind":{"$ref":"#/components/schemas/TagKind"},"message":{"type":"string","description":"Annotated tag message, if present","nullable":true},"name":{"type":"string","description":"Name"}}},"TagKind":{"type":"string","enum":["lightweight","annotated"]},"TagsResponse":{"type":"object","required":["tags"],"properties":{"tags":{"type":"array","items":{"$ref":"#/components/schemas/TagInfo"},"description":"List of tags"}}},"TimelineEvent":{"type":"object","required":["type","timestamp","authorUsername"],"properties":{"authorUsername":{"type":"string","description":"Actor username"},"label":{"type":"string","description":"Label name, set for `label_added` and `label_removed` events","nullable":true},"newTitle":{"type":"string","description":"New title, set for `title_changed` events","nullable":true},"oldTitle":{"type":"string","description":"Previous title, set for `title_changed` events","nullable":true},"status":{"type":"string","description":"New status (`\"open\"` or `\"closed\"`), set for `status_changed` events","nullable":true},"timestamp":{"type":"integer","format":"int64","description":"Unix timestamp"},"type":{"type":"string","description":"Type"}}},"UpdateLabelRequest":{"type":"object","properties":{"color":{"type":"string","description":"New hex color","nullable":true},"description":{"type":"string","description":"New description","nullable":true},"name":{"type":"string","description":"New label name","nullable":true}}},"UpdateMilestoneRequest":{"type":"object","properties":{"closed":{"type":"boolean","description":"Whether the milestone is closed","nullable":true},"description":{"type":"string","description":"Description","nullable":true},"dueDate":{"type":"string","format":"date-time","description":"Due date (set to null to clear)","nullable":true},"title":{"type":"string","description":"Title","nullable":true}}},"UpdateReleaseRequest":{"type":"object","properties":{"description":{"type":"string","nullable":true},"preRelease":{"type":"boolean","nullable":true},"title":{"type":"string","nullable":true}}},"UploadAvatarResponse":{"type":"object","required":["uploadUrl"],"properties":{"uploadUrl":{"type":"string","description":"S3 pre-signed URL to upload avatar to"}}},"UpsertCollaboratorRequest":{"type":"object","required":["username","accessLevel"],"properties":{"accessLevel":{"$ref":"#/components/schemas/AccessLevel"},"username":{"type":"string"}}},"UserProfileRepo":{"type":"object","required":["id","name","description","visibility","languages","stars"],"properties":{"archivedAt":{"type":"string","format":"date-time","nullable":true},"description":{"type":"string"},"id":{"type":"string","format":"uuid"},"languages":{"$ref":"#/components/schemas/JsonValue"},"name":{"type":"string"},"stars":{"type":"integer","format":"int64"},"visibility":{"$ref":"#/components/schemas/RepoVisibility"}}},"UserProfileResponse":{"type":"object","required":["id","username","admin","repos","stats"],"properties":{"admin":{"type":"boolean"},"id":{"type":"string","format":"uuid"},"repos":{"type":"array","items":{"$ref":"#/components/schemas/UserProfileRepo"}},"stats":{"$ref":"#/components/schemas/UserProfileStats"},"username":{"type":"string"}}},"UserProfileStats":{"type":"object","required":["repos","starsEarned","starsGiven"],"properties":{"repos":{"type":"integer","format":"int64"},"starsEarned":{"type":"integer","format":"int64"},"starsGiven":{"type":"integer","format":"int64"}}},"UserSearchResponse":{"type":"object","required":["total","users"],"properties":{"total":{"type":"integer","format":"int64","minimum":0},"users":{"type":"array","items":{"$ref":"#/components/schemas/SearchUser"}}}}},"securitySchemes":{"cookieAuth":{"type":"apiKey","in":"cookie","name":"gitarena-auth"}}},"tags":[{"name":"api","description":"General API endpoints"},{"name":"explore","description":"Explore public repositories"},{"name":"repository","description":"Repository management"},{"name":"organization","description":"Organization management"},{"name":"user","description":"User account management"},{"name":"search","description":"Search endpoints"},{"name":"admin","description":"Instance management for admins"}]}