Gitea · Schema
PullRequest
PullRequest represents a pull request
GitSource ControlDevOpsCI/CDCode HostingOpen SourceSelf HostedPackage RegistryIssue TrackingPull Requests
Properties
| Name | Type | Description |
|---|---|---|
| additions | integer | The number of lines added in the pull request |
| allow_maintainer_edit | boolean | Whether maintainers can edit the pull request |
| assignee | object | |
| assignees | array | The list of users assigned to the pull request |
| base | object | |
| body | string | The description body of the pull request |
| changed_files | integer | The number of files changed in the pull request |
| closed_at | string | |
| comments | integer | The number of comments on the pull request |
| content_version | integer | The version of the pull request content for optimistic locking |
| created_at | string | |
| deletions | integer | The number of lines deleted in the pull request |
| diff_url | string | The URL to download the diff patch |
| draft | boolean | Whether the pull request is a draft |
| due_date | string | |
| head | object | |
| html_url | string | The HTML URL to view the pull request |
| id | integer | The unique identifier of the pull request |
| is_locked | boolean | Whether the pull request conversation is locked |
| labels | array | The labels attached to the pull request |
| merge_base | string | The merge base commit SHA |
| merge_commit_sha | string | The SHA of the merge commit |
| mergeable | boolean | Whether the pull request can be merged |
| merged | boolean | Whether the pull request has been merged |
| merged_at | string | |
| merged_by | object | |
| milestone | object | |
| number | integer | The pull request number |
| patch_url | string | The URL to download the patch file |
| pin_order | integer | The pin order for the pull request |
| requested_reviewers | array | The users requested to review the pull request |
| requested_reviewers_teams | array | The teams requested to review the pull request |
| review_comments | integer | number of review comments made on the diff of a PR review (not including comments on commits or issues in a PR) |
| state | string | The current state of the pull request open StateOpen StateOpen pr is opened closed StateClosed StateClosed pr is closed |
| title | string | The title of the pull request |
| updated_at | string | |
| url | string | The API URL of the pull request |
| user | object |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/api-evangelist/gitea/main/json-schema/gitea-rest-api-pullrequest-schema.json",
"title": "PullRequest",
"description": "PullRequest represents a pull request",
"type": "object",
"properties": {
"additions": {
"description": "The number of lines added in the pull request",
"type": "integer",
"format": "int64",
"x-go-name": "Additions"
},
"allow_maintainer_edit": {
"description": "Whether maintainers can edit the pull request",
"type": "boolean",
"x-go-name": "AllowMaintainerEdit"
},
"assignee": {
"$ref": "#/$defs/User"
},
"assignees": {
"description": "The list of users assigned to the pull request",
"type": "array",
"items": {
"$ref": "#/$defs/User"
},
"x-go-name": "Assignees"
},
"base": {
"$ref": "#/$defs/PRBranchInfo"
},
"body": {
"description": "The description body of the pull request",
"type": "string",
"x-go-name": "Body"
},
"changed_files": {
"description": "The number of files changed in the pull request",
"type": "integer",
"format": "int64",
"x-go-name": "ChangedFiles"
},
"closed_at": {
"type": "string",
"format": "date-time",
"x-go-name": "Closed"
},
"comments": {
"description": "The number of comments on the pull request",
"type": "integer",
"format": "int64",
"x-go-name": "Comments"
},
"content_version": {
"description": "The version of the pull request content for optimistic locking",
"type": "integer",
"format": "int64",
"x-go-name": "ContentVersion"
},
"created_at": {
"type": "string",
"format": "date-time",
"x-go-name": "Created"
},
"deletions": {
"description": "The number of lines deleted in the pull request",
"type": "integer",
"format": "int64",
"x-go-name": "Deletions"
},
"diff_url": {
"description": "The URL to download the diff patch",
"type": "string",
"x-go-name": "DiffURL"
},
"draft": {
"description": "Whether the pull request is a draft",
"type": "boolean",
"x-go-name": "Draft"
},
"due_date": {
"type": "string",
"format": "date-time",
"x-go-name": "Deadline"
},
"head": {
"$ref": "#/$defs/PRBranchInfo"
},
"html_url": {
"description": "The HTML URL to view the pull request",
"type": "string",
"x-go-name": "HTMLURL"
},
"id": {
"description": "The unique identifier of the pull request",
"type": "integer",
"format": "int64",
"x-go-name": "ID"
},
"is_locked": {
"description": "Whether the pull request conversation is locked",
"type": "boolean",
"x-go-name": "IsLocked"
},
"labels": {
"description": "The labels attached to the pull request",
"type": "array",
"items": {
"$ref": "#/$defs/Label"
},
"x-go-name": "Labels"
},
"merge_base": {
"description": "The merge base commit SHA",
"type": "string",
"x-go-name": "MergeBase"
},
"merge_commit_sha": {
"description": "The SHA of the merge commit",
"type": "string",
"x-go-name": "MergedCommitID"
},
"mergeable": {
"description": "Whether the pull request can be merged",
"type": "boolean",
"x-go-name": "Mergeable"
},
"merged": {
"description": "Whether the pull request has been merged",
"type": "boolean",
"x-go-name": "HasMerged"
},
"merged_at": {
"type": "string",
"format": "date-time",
"x-go-name": "Merged"
},
"merged_by": {
"$ref": "#/$defs/User"
},
"milestone": {
"$ref": "#/$defs/Milestone"
},
"number": {
"description": "The pull request number",
"type": "integer",
"format": "int64",
"x-go-name": "Index"
},
"patch_url": {
"description": "The URL to download the patch file",
"type": "string",
"x-go-name": "PatchURL"
},
"pin_order": {
"description": "The pin order for the pull request",
"type": "integer",
"format": "int64",
"x-go-name": "PinOrder"
},
"requested_reviewers": {
"description": "The users requested to review the pull request",
"type": "array",
"items": {
"$ref": "#/$defs/User"
},
"x-go-name": "RequestedReviewers"
},
"requested_reviewers_teams": {
"description": "The teams requested to review the pull request",
"type": "array",
"items": {
"$ref": "#/$defs/Team"
},
"x-go-name": "RequestedReviewersTeams"
},
"review_comments": {
"description": "number of review comments made on the diff of a PR review (not including comments on commits or issues in a PR)",
"type": "integer",
"format": "int64",
"x-go-name": "ReviewComments"
},
"state": {
"description": "The current state of the pull request\nopen StateOpen StateOpen pr is opened\nclosed StateClosed StateClosed pr is closed",
"type": "string",
"enum": [
"open",
"closed"
],
"x-go-enum-desc": "open StateOpen StateOpen pr is opened\nclosed StateClosed StateClosed pr is closed",
"x-go-name": "State"
},
"title": {
"description": "The title of the pull request",
"type": "string",
"x-go-name": "Title"
},
"updated_at": {
"type": "string",
"format": "date-time",
"x-go-name": "Updated"
},
"url": {
"description": "The API URL of the pull request",
"type": "string",
"x-go-name": "URL"
},
"user": {
"$ref": "#/$defs/User"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs",
"$defs": {
"Team": {
"description": "Team represents a team in an organization",
"type": "object",
"properties": {
"can_create_org_repo": {
"description": "Whether the team can create repositories in the organization",
"type": "boolean",
"x-go-name": "CanCreateOrgRepo"
},
"description": {
"description": "The description of the team",
"type": "string",
"x-go-name": "Description"
},
"id": {
"description": "The unique identifier of the team",
"type": "integer",
"format": "int64",
"x-go-name": "ID"
},
"includes_all_repositories": {
"description": "Whether the team has access to all repositories in the organization",
"type": "boolean",
"x-go-name": "IncludesAllRepositories"
},
"name": {
"description": "The name of the team",
"type": "string",
"x-go-name": "Name"
},
"organization": {
"$ref": "#/$defs/Organization"
},
"permission": {
"type": "string",
"enum": [
"none",
"read",
"write",
"admin",
"owner"
],
"x-go-name": "Permission"
},
"units": {
"type": "array",
"items": {
"type": "string"
},
"x-go-name": "Units",
"example": [
"repo.code",
"repo.issues",
"repo.ext_issues",
"repo.wiki",
"repo.pulls",
"repo.releases",
"repo.projects",
"repo.ext_wiki"
]
},
"units_map": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"x-go-name": "UnitsMap",
"example": {
"repo.code": "read",
"repo.ext_issues": "none",
"repo.ext_wiki": "none",
"repo.issues": "write",
"repo.projects": "none",
"repo.pulls": "owner",
"repo.releases": "none",
"repo.wiki": "admin"
}
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"Milestone": {
"description": "Milestone milestone is a collection of issues on one repository",
"type": "object",
"properties": {
"closed_at": {
"type": "string",
"format": "date-time",
"x-go-name": "Closed"
},
"closed_issues": {
"description": "ClosedIssues is the number of closed issues in this milestone",
"type": "integer",
"format": "int64",
"x-go-name": "ClosedIssues"
},
"created_at": {
"type": "string",
"format": "date-time",
"x-go-name": "Created"
},
"description": {
"description": "Description provides details about the milestone",
"type": "string",
"x-go-name": "Description"
},
"due_on": {
"type": "string",
"format": "date-time",
"x-go-name": "Deadline"
},
"id": {
"description": "ID is the unique identifier for the milestone",
"type": "integer",
"format": "int64",
"x-go-name": "ID"
},
"open_issues": {
"description": "OpenIssues is the number of open issues in this milestone",
"type": "integer",
"format": "int64",
"x-go-name": "OpenIssues"
},
"state": {
"description": "State indicates if the milestone is open or closed\nopen StateOpen StateOpen pr is opened\nclosed StateClosed StateClosed pr is closed",
"type": "string",
"enum": [
"open",
"closed"
],
"x-go-enum-desc": "open StateOpen StateOpen pr is opened\nclosed StateClosed StateClosed pr is closed",
"x-go-name": "State"
},
"title": {
"description": "Title is the title of the milestone",
"type": "string",
"x-go-name": "Title"
},
"updated_at": {
"type": "string",
"format": "date-time",
"x-go-name": "Updated"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"User": {
"description": "User represents a user",
"type": "object",
"properties": {
"active": {
"description": "Is user active",
"type": "boolean",
"x-go-name": "IsActive"
},
"avatar_url": {
"description": "URL to the user's avatar",
"type": "string",
"x-go-name": "AvatarURL"
},
"created": {
"type": "string",
"format": "date-time",
"x-go-name": "Created"
},
"description": {
"description": "the user's description",
"type": "string",
"x-go-name": "Description"
},
"email": {
"type": "string",
"format": "email",
"x-go-name": "Email"
},
"followers_count": {
"description": "user counts",
"type": "integer",
"format": "int64",
"x-go-name": "Followers"
},
"following_count": {
"type": "integer",
"format": "int64",
"x-go-name": "Following"
},
"full_name": {
"description": "the user's full name",
"type": "string",
"x-go-name": "FullName"
},
"html_url": {
"description": "URL to the user's gitea page",
"type": "string",
"x-go-name": "HTMLURL"
},
"id": {
"description": "the user's id",
"type": "integer",
"format": "int64",
"x-go-name": "ID"
},
"is_admin": {
"description": "Is the user an administrator",
"type": "boolean",
"x-go-name": "IsAdmin"
},
"language": {
"description": "User locale",
"type": "string",
"x-go-name": "Language"
},
"last_login": {
"type": "string",
"format": "date-time",
"x-go-name": "LastLogin"
},
"location": {
"description": "the user's location",
"type": "string",
"x-go-name": "Location"
},
"login": {
"description": "login of the user, same as `username`",
"type": "string",
"x-go-name": "UserName"
},
"login_name": {
"description": "identifier of the user, provided by the external authenticator (if configured)",
"type": "string",
"default": "empty",
"x-go-name": "LoginName"
},
"prohibit_login": {
"description": "Is user login prohibited",
"type": "boolean",
"x-go-name": "ProhibitLogin"
},
"restricted": {
"description": "Is user restricted",
"type": "boolean",
"x-go-name": "Restricted"
},
"source_id": {
"description": "The ID of the user's Authentication Source",
"type": "integer",
"format": "int64",
"x-go-name": "SourceID"
},
"starred_repos_count": {
"type": "integer",
"format": "int64",
"x-go-name": "StarredRepos"
},
"visibility": {
"description": "User visibility level option: public, limited, private",
"type": "string",
"x-go-name": "Visibility"
},
"website": {
"description": "the user's website",
"type": "string",
"x-go-name": "Website"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"RepoTransfer": {
"description": "RepoTransfer represents a pending repo transfer",
"type": "object",
"properties": {
"doer": {
"$ref": "#/$defs/User"
},
"recipient": {
"$ref": "#/$defs/User"
},
"teams": {
"type": "array",
"items": {
"$ref": "#/$defs/Team"
},
"x-go-name": "Teams"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"Organization": {
"description": "Organization represents an organization",
"type": "object",
"properties": {
"avatar_url": {
"description": "The URL of the organization's avatar",
"type": "string",
"x-go-name": "AvatarURL"
},
"description": {
"description": "The description of the organization",
"type": "string",
"x-go-name": "Description"
},
"email": {
"description": "The email address of the organization",
"type": "string",
"x-go-name": "Email"
},
"full_name": {
"description": "The full display name of the organization",
"type": "string",
"x-go-name": "FullName"
},
"id": {
"description": "The unique identifier of the organization",
"type": "integer",
"format": "int64",
"x-go-name": "ID"
},
"location": {
"description": "The location of the organization",
"type": "string",
"x-go-name": "Location"
},
"name": {
"description": "The name of the organization",
"type": "string",
"x-go-name": "Name"
},
"repo_admin_change_team_access": {
"description": "Whether repository administrators can change team access",
"type": "boolean",
"x-go-name": "RepoAdminChangeTeamAccess"
},
"username": {
"description": "username of the organization\ndeprecated",
"type": "string",
"x-go-name": "UserName"
},
"visibility": {
"description": "The visibility level of the organization (public, limited, private)",
"type": "string",
"x-go-name": "Visibility"
},
"website": {
"description": "The website URL of the organization",
"type": "string",
"x-go-name": "Website"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"InternalTracker": {
"description": "InternalTracker represents settings for internal tracker",
"type": "object",
"properties": {
"allow_only_contributors_to_track_time": {
"description": "Let only contributors track time (Built-in issue tracker)",
"type": "boolean",
"x-go-name": "AllowOnlyContributorsToTrackTime"
},
"enable_issue_dependencies": {
"description": "Enable dependencies for issues and pull requests (Built-in issue tracker)",
"type": "boolean",
"x-go-name": "EnableIssueDependencies"
},
"enable_time_tracker": {
"description": "Enable time tracking (Built-in issue tracker)",
"type": "boolean",
"x-go-name": "EnableTimeTracker"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"PRBranchInfo": {
"description": "PRBranchInfo information about a branch",
"type": "object",
"properties": {
"label": {
"description": "The display name of the branch",
"type": "string",
"x-go-name": "Name"
},
"ref": {
"description": "The git reference of the branch",
"type": "string",
"x-go-name": "Ref"
},
"repo": {
"$ref": "#/$defs/Repository"
},
"repo_id": {
"description": "The unique identifier of the repository",
"type": "integer",
"format": "int64",
"x-go-name": "RepoID"
},
"sha": {
"description": "The commit SHA of the branch head",
"type": "string",
"x-go-name": "Sha"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"Repository": {
"description": "Repository represents a repository",
"type": "object",
"properties": {
"allow_fast_forward_only_merge": {
"type": "boolean",
"x-go-name": "AllowFastForwardOnly"
},
"allow_manual_merge": {
"type": "boolean",
"x-go-name": "AllowManualMerge"
},
"allow_merge_commits": {
"type": "boolean",
"x-go-name": "AllowMerge"
},
"allow_rebase": {
"type": "boolean",
"x-go-name": "AllowRebase"
},
"allow_rebase_explicit": {
"type": "boolean",
"x-go-name": "AllowRebaseMerge"
},
"allow_rebase_update": {
"type": "boolean",
"x-go-name": "AllowRebaseUpdate"
},
"allow_squash_merge": {
"type": "boolean",
"x-go-name": "AllowSquash"
},
"archived": {
"type": "boolean",
"x-go-name": "Archived"
},
"archived_at": {
"type": "string",
"format": "date-time",
"x-go-name": "ArchivedAt"
},
"autodetect_manual_merge": {
"type": "boolean",
"x-go-name": "AutodetectManualMerge"
},
"avatar_url": {
"type": "string",
"x-go-name": "AvatarURL"
},
"branch_count": {
"type": "integer",
"format": "int64",
"x-go-name": "BranchCount"
},
"clone_url": {
"type": "string",
"x-go-name": "CloneURL"
},
"created_at": {
"type": "string",
"format": "date-time",
"x-go-name": "Created"
},
"default_allow_maintainer_edit": {
"type": "boolean",
"x-go-name": "DefaultAllowMaintainerEdit"
},
"default_branch": {
"type": "string",
"x-go-name": "DefaultBranch"
},
"default_delete_branch_after_merge": {
"type": "boolean",
"x-go-name": "DefaultDeleteBranchAfterMerge"
},
"default_merge_style": {
"type": "string",
"x-go-name": "DefaultMergeStyle"
},
"default_target_branch": {
"type": "string",
"x-go-name": "DefaultTargetBranch"
},
"description": {
"type": "string",
"x-go-name": "Description"
},
"empty": {
"type": "boolean",
"x-go-name": "Empty"
},
"external_tracker": {
"$ref": "#/$defs/ExternalTracker"
},
"external_wiki": {
"$ref": "#/$defs/ExternalWiki"
},
"fork": {
"type": "boolean",
"x-go-name": "Fork"
},
"forks_count": {
"type": "integer",
"format": "int64",
"x-go-name": "Forks"
},
"full_name": {
"type": "string",
"x-go-name": "FullName"
},
"has_actions": {
"type": "boolean",
"x-go-name": "HasActions"
},
"has_code": {
"type": "boolean",
"x-go-name": "HasCode"
},
"has_issues": {
"type": "boolean",
"x-go-name": "HasIssues"
},
"has_packages": {
"type": "boolean",
"x-go-name": "HasPackages"
},
"has_projects": {
"type": "boolean",
"x-go-name": "HasProjects"
},
"has_pull_requests": {
"type": "boolean",
"x-go-name": "HasPullRequests"
},
"has_releases": {
"type": "boolean",
"x-go-name": "HasReleases"
},
"has_wiki": {
"type": "boolean",
"x-go-name": "HasWiki"
},
"html_url": {
"type": "string",
"x-go-name": "HTMLURL"
},
"id": {
"type": "integer",
"format": "int64",
"x-go-name": "ID"
},
"ignore_whitespace_conflicts": {
"type": "boolean",
"x-go-name": "IgnoreWhitespaceConflicts"
},
"internal": {
"type": "boolean",
"x-go-name": "Internal"
},
"internal_tracker": {
"$ref": "#/$defs/InternalTracker"
},
"language": {
"type": "string",
"x-go-name": "Language"
},
"languages_url": {
"type": "string",
"x-go-name": "LanguagesURL"
},
"licenses": {
"type": "array",
"items": {
"type": "string"
},
"x-go-name": "Licenses"
},
"link": {
"type": "string",
"x-go-name": "Link"
},
"mirror": {
"type": "boolean",
"x-go-name": "Mirror"
},
"mirror_interval": {
"type": "string",
"x-go-name": "MirrorInterval"
},
"mirror_updated": {
"type": "string",
"format": "date-time",
"x-go-name": "MirrorUpdated"
},
"name": {
"type": "string",
"x-go-name": "Name"
},
"object_format_name": {
"description": "ObjectFormatName of the underlying git repository",
"type": "string",
"enum": [
"sha1",
"sha256"
],
"x-go-name": "ObjectFormatName"
},
"open_issues_count": {
"type": "integer",
"format": "int64",
"x-go-name": "OpenIssues"
},
"open_pr_counter": {
"type": "integer",
"format": "int64",
"x-go-name": "OpenPulls"
},
"original_url": {
"type": "string",
"x-go-name": "OriginalURL"
},
"owner": {
"$ref": "#/$defs/User"
},
"parent": {
"$ref": "#/$defs/Repository"
},
"permissions": {
"$ref": "#/$defs/Permission"
},
"private": {
"type": "boolean",
"x-go-name": "Private"
},
"projects_mode": {
"type": "string",
"x-go-name": "ProjectsMode"
},
"release_counter": {
"type": "integer",
"format": "int64",
"x-go-name": "Releases"
},
"repo_transfer": {
"$ref": "#/$defs/RepoTransfer"
},
"size": {
"type": "integer",
"format": "int64",
"x-go-name": "Size"
},
"ssh_url": {
"type": "string",
"x-go-name": "SSHURL"
},
"stars_count": {
"type": "integer",
"format": "int64",
"x-go-name": "Stars"
},
"template": {
"type": "boolean",
"x-go-name": "Template"
},
"topics": {
"type": "array",
"items": {
"type": "string"
},
"x-go-name": "Topics"
},
"updated_at": {
"type": "string",
"format": "date-time",
"x-go-name": "Updated"
},
"url": {
"type": "string",
"x-go-name": "URL"
},
"watchers_count": {
"type": "integer",
"format": "int64",
"x-go-name": "Watchers"
},
"website": {
"type": "string",
"x-go-name": "Website"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"ExternalTracker": {
"description": "ExternalTracker represents settings for external tracker",
"type": "object",
"properties": {
"external_tracker_format": {
"description": "External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index.",
"type": "string",
"x-go-name": "ExternalTrackerFormat"
},
"external_tracker_regexp_pattern": {
"description": "External Issue Tracker issue regular expression",
"type": "string",
"x-go-name": "ExternalTrackerRegexpPattern"
},
"external_tracker_style": {
"description": "External Issue Tracker Number Format, either `numeric`, `alphanumeric`, or `regexp`",
"type": "string",
"x-go-name": "ExternalTrackerStyle"
},
"external_tracker_url": {
"description": "URL of external issue tracker.",
"type": "string",
"x-go-name": "ExternalTrackerURL"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"Permission": {
"description": "Permission represents a set of permissions",
"type": "object",
"properties": {
"admin": {
"type": "boolean",
"x-go-name": "Admin"
},
"pull": {
"type": "boolean",
"x-go-name": "Pull"
},
"push": {
"type": "boolean",
"x-go-name": "Push"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"Label": {
"description": "Label a label to an issue or a pr",
"type": "object",
"properties": {
"color": {
"type": "string",
"x-go-name": "Color",
"example": "00aabb"
},
"description": {
"description": "Description provides additional context about the label's purpose",
"type": "string",
"x-go-name": "Description"
},
"exclusive": {
"type": "boolean",
"x-go-name": "Exclusive",
"example": false
},
"id": {
"description": "ID is the unique identifier for the label",
"type": "integer",
"format": "int64",
"x-go-name": "ID"
},
"is_archived": {
"type": "boolean",
"x-go-name": "IsArchived",
"example": false
},
"name": {
"description": "Name is the display name of the label",
"type": "string",
"x-go-name": "Name"
},
"url": {
"description": "URL is the API endpoint for accessing this label",
"type": "string",
"x-go-name": "URL"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"ExternalWiki": {
"description": "ExternalWiki represents setting for external wiki",
"type": "object",
"properties": {
"external_wiki_url": {
"description": "URL of external wiki.",
"type": "string",
"x-go-name": "ExternalWikiURL"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
}
}
}