Skip to content

Commit cb27c43

Browse files
authored
Document possible action types for the user activity feed API (#31196)
Resolves #31131. It uses the the go-swagger `enum` property to document the activity action types.
1 parent fc641b3 commit cb27c43

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

modules/structs/activity.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ package structs
66
import "time"
77

88
type Activity struct {
9-
ID int64 `json:"id"`
10-
UserID int64 `json:"user_id"` // Receiver user
9+
ID int64 `json:"id"`
10+
UserID int64 `json:"user_id"` // Receiver user
11+
// the type of action
12+
//
13+
// enum: create_repo,rename_repo,star_repo,watch_repo,commit_repo,create_issue,create_pull_request,transfer_repo,push_tag,comment_issue,merge_pull_request,close_issue,reopen_issue,close_pull_request,reopen_pull_request,delete_tag,delete_branch,mirror_sync_push,mirror_sync_create,mirror_sync_delete,approve_pull_request,reject_pull_request,comment_pull,publish_release,pull_review_dismissed,pull_request_ready_for_review,auto_merge_pull_request
1114
OpType string `json:"op_type"`
1215
ActUserID int64 `json:"act_user_id"`
1316
ActUser *User `json:"act_user"`

templates/swagger/v1_json.tmpl

+30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)