Skip to content

Commit 5f54a38

Browse files
add appropriate swagger definitions
1 parent 2990f92 commit 5f54a38

File tree

4 files changed

+405
-5
lines changed

4 files changed

+405
-5
lines changed

modules/structs/repo_group.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package structs
22

33
// Group represents a group of repositories and subgroups in an organization
4-
// swagger:model
54
type Group struct {
65
ID int64 `json:"id"`
76
Owner *User `json:"owner"`
@@ -14,7 +13,7 @@ type Group struct {
1413
SortOrder int `json:"sort_order"`
1514
}
1615

17-
// NewGroupOption - options for creating a new group in an organization
16+
// NewGroupOption represents options for creating a new group in an organization
1817
// swagger:model
1918
type NewGroupOption struct {
2019
// the name for the newly created group
@@ -27,7 +26,7 @@ type NewGroupOption struct {
2726
Visibility VisibleType `json:"visibility"`
2827
}
2928

30-
// MoveGroupOption - options for changing a group or repo's parent and sort order
29+
// MoveGroupOption represents options for changing a group or repo's parent and sort order
3130
// swagger:model
3231
type MoveGroupOption struct {
3332
// the new parent group. can be 0 to specify no parent
@@ -38,7 +37,7 @@ type MoveGroupOption struct {
3837
NewPos *int `json:"newPos,omitempty"`
3938
}
4039

41-
// EditGroupOption - options for editing a repository group
40+
// EditGroupOption represents options for editing a repository group
4241
// swagger:model
4342
type EditGroupOption struct {
4443
// the new name of the group

routers/api/v1/swagger/options.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,13 @@ type swaggerParameterBodies struct {
222222

223223
// in:body
224224
LockIssueOption api.LockIssueOption
225+
226+
// in:body
227+
NewGroupOption api.NewGroupOption
228+
229+
// in:body
230+
EditGroupOption api.EditGroupOption
231+
232+
// in:body
233+
MoveGroupOption api.MoveGroupOption
225234
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package swagger
2+
3+
import api "code.gitea.io/gitea/modules/structs"
4+
5+
// Group
6+
// swagger:response Group
7+
type swaggerResponseGroup struct {
8+
// in:body
9+
Body api.Group `json:"body"`
10+
}
11+
12+
// GroupList
13+
// swagger:response GroupList
14+
type swaggerResponseGroupList struct {
15+
// in:body
16+
Body []api.Group `json:"body"`
17+
}

0 commit comments

Comments
 (0)