GitLab · Schema
GitLab Merge Request
A GitLab merge request proposing changes from a source branch to be merged into a target branch within a project.
CodePlatformSoftware DevelopmentSource Control
Properties
| Name | Type | Description |
|---|---|---|
| id | integer | The globally unique identifier of the merge request. |
| iid | integer | The internal project-scoped ID of the merge request. |
| project_id | integer | The ID of the project the merge request belongs to. |
| title | string | The title of the merge request. |
| description | stringnull | The description of the merge request, supporting Markdown syntax. |
| state | string | The current state of the merge request. |
| draft | boolean | Whether the merge request is in draft state and not ready for review. |
| source_branch | string | The name of the source branch containing the changes. |
| target_branch | string | The name of the target branch to merge changes into. |
| source_project_id | integer | The ID of the project containing the source branch. |
| target_project_id | integer | The ID of the project containing the target branch. |
| author | object | |
| assignees | array | Users assigned to review and merge this merge request. |
| reviewers | array | Users requested to review this merge request. |
| merge_user | object | The user who merged the merge request. |
| labels | array | Labels applied to the merge request. |
| milestone | object | The milestone the merge request is associated with. |
| detailed_merge_status | string | The detailed merge readiness status of the merge request. |
| sha | stringnull | The HEAD commit SHA of the source branch. |
| merge_commit_sha | stringnull | The SHA of the merge commit, set after merging. |
| squash_commit_sha | stringnull | The SHA of the squash commit, set after squash merging. |
| squash | boolean | Whether the merge request is configured to squash commits on merge. |
| references | object | |
| web_url | string | The URL to view the merge request in a browser. |
| upvotes | integer | The number of upvotes the merge request has received. |
| downvotes | integer | The number of downvotes the merge request has received. |
| user_notes_count | integer | The number of user-authored comments on the merge request. |
| changes_count | stringnull | The number of files changed. May be a string for large diffs. |
| created_at | string | The date and time the merge request was created. |
| updated_at | string | The date and time the merge request was last updated. |
| merged_at | stringnull | The date and time the merge request was merged. |
| prepared_at | stringnull | The date and time the merge request was prepared for merging. |
| closed_at | stringnull | The date and time the merge request was closed without merging. |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://gitlab.com/schemas/gitlab/merge-request.json",
"title": "GitLab Merge Request",
"description": "A GitLab merge request proposing changes from a source branch to be merged into a target branch within a project.",
"type": "object",
"required": ["id", "iid", "project_id", "title", "state"],
"properties": {
"id": {
"type": "integer",
"description": "The globally unique identifier of the merge request."
},
"iid": {
"type": "integer",
"description": "The internal project-scoped ID of the merge request."
},
"project_id": {
"type": "integer",
"description": "The ID of the project the merge request belongs to."
},
"title": {
"type": "string",
"description": "The title of the merge request.",
"maxLength": 255
},
"description": {
"type": ["string", "null"],
"description": "The description of the merge request, supporting Markdown syntax.",
"maxLength": 1048576
},
"state": {
"type": "string",
"enum": ["opened", "closed", "merged", "locked"],
"description": "The current state of the merge request."
},
"draft": {
"type": "boolean",
"description": "Whether the merge request is in draft state and not ready for review."
},
"source_branch": {
"type": "string",
"description": "The name of the source branch containing the changes."
},
"target_branch": {
"type": "string",
"description": "The name of the target branch to merge changes into."
},
"source_project_id": {
"type": "integer",
"description": "The ID of the project containing the source branch."
},
"target_project_id": {
"type": "integer",
"description": "The ID of the project containing the target branch."
},
"author": {
"$ref": "#/$defs/UserSummary"
},
"assignees": {
"type": "array",
"description": "Users assigned to review and merge this merge request.",
"items": {
"$ref": "#/$defs/UserSummary"
}
},
"reviewers": {
"type": "array",
"description": "Users requested to review this merge request.",
"items": {
"$ref": "#/$defs/UserSummary"
}
},
"merge_user": {
"oneOf": [
{ "$ref": "#/$defs/UserSummary" },
{ "type": "null" }
],
"description": "The user who merged the merge request."
},
"labels": {
"type": "array",
"description": "Labels applied to the merge request.",
"items": {
"type": "string"
}
},
"milestone": {
"oneOf": [
{ "$ref": "#/$defs/Milestone" },
{ "type": "null" }
],
"description": "The milestone the merge request is associated with."
},
"detailed_merge_status": {
"type": "string",
"description": "The detailed merge readiness status of the merge request.",
"enum": [
"blocked_status",
"broken_status",
"checking",
"ci_must_pass",
"ci_still_running",
"discussions_not_resolved",
"draft_status",
"external_status_checks",
"mergeable",
"not_approved",
"not_open",
"policies_denied",
"unchecked"
]
},
"sha": {
"type": ["string", "null"],
"description": "The HEAD commit SHA of the source branch."
},
"merge_commit_sha": {
"type": ["string", "null"],
"description": "The SHA of the merge commit, set after merging."
},
"squash_commit_sha": {
"type": ["string", "null"],
"description": "The SHA of the squash commit, set after squash merging."
},
"squash": {
"type": "boolean",
"description": "Whether the merge request is configured to squash commits on merge."
},
"references": {
"$ref": "#/$defs/References"
},
"web_url": {
"type": "string",
"format": "uri",
"description": "The URL to view the merge request in a browser."
},
"upvotes": {
"type": "integer",
"minimum": 0,
"description": "The number of upvotes the merge request has received."
},
"downvotes": {
"type": "integer",
"minimum": 0,
"description": "The number of downvotes the merge request has received."
},
"user_notes_count": {
"type": "integer",
"minimum": 0,
"description": "The number of user-authored comments on the merge request."
},
"changes_count": {
"type": ["string", "null"],
"description": "The number of files changed. May be a string for large diffs."
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "The date and time the merge request was created."
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "The date and time the merge request was last updated."
},
"merged_at": {
"type": ["string", "null"],
"format": "date-time",
"description": "The date and time the merge request was merged."
},
"prepared_at": {
"type": ["string", "null"],
"format": "date-time",
"description": "The date and time the merge request was prepared for merging."
},
"closed_at": {
"type": ["string", "null"],
"format": "date-time",
"description": "The date and time the merge request was closed without merging."
}
},
"$defs": {
"UserSummary": {
"type": "object",
"description": "A simplified representation of a GitLab user.",
"required": ["id", "username"],
"properties": {
"id": {
"type": "integer",
"description": "The unique identifier of the user."
},
"username": {
"type": "string",
"description": "The username of the user."
},
"name": {
"type": "string",
"description": "The display name of the user."
},
"state": {
"type": "string",
"enum": ["active", "blocked", "deactivated"],
"description": "The current state of the user account."
},
"avatar_url": {
"type": ["string", "null"],
"format": "uri",
"description": "URL to the user's avatar image."
},
"web_url": {
"type": "string",
"format": "uri",
"description": "URL to the user's GitLab profile page."
}
}
},
"Milestone": {
"type": "object",
"description": "A milestone that groups issues and merge requests by a target date.",
"properties": {
"id": {
"type": "integer",
"description": "The unique identifier of the milestone."
},
"iid": {
"type": "integer",
"description": "The project-scoped ID of the milestone."
},
"project_id": {
"type": "integer",
"description": "The ID of the project the milestone belongs to."
},
"title": {
"type": "string",
"description": "The title of the milestone."
},
"description": {
"type": ["string", "null"],
"description": "The description of the milestone."
},
"state": {
"type": "string",
"enum": ["active", "closed"],
"description": "The current state of the milestone."
},
"due_date": {
"type": ["string", "null"],
"format": "date",
"description": "The due date of the milestone in YYYY-MM-DD format."
},
"web_url": {
"type": "string",
"format": "uri",
"description": "URL to view the milestone in a browser."
}
}
},
"References": {
"type": "object",
"description": "Reference strings for the merge request.",
"properties": {
"short": {
"type": "string",
"description": "Short reference format, for example !42."
},
"relative": {
"type": "string",
"description": "Relative reference format including project path."
},
"full": {
"type": "string",
"description": "Full reference format including namespace and project path."
}
}
}
}
}