Skip to content

Commit d638067

Browse files
authored
API: enhance SearchIssues swagger docs (#32208)
this will result in better api clients generated out of the openapi docs ... for SearchIssues --- *Sponsored by Kithara Software GmbH*
1 parent 08c963c commit d638067

File tree

2 files changed

+73
-36
lines changed

2 files changed

+73
-36
lines changed

routers/api/v1/repo/issue.go

+32-19
Original file line numberDiff line numberDiff line change
@@ -41,80 +41,93 @@ func SearchIssues(ctx *context.APIContext) {
4141
// parameters:
4242
// - name: state
4343
// in: query
44-
// description: whether issue is open or closed
44+
// description: State of the issue
4545
// type: string
46+
// enum: [open, closed, all]
47+
// default: open
4648
// - name: labels
4749
// in: query
48-
// description: comma separated list of labels. Fetch only issues that have any of this labels. Non existent labels are discarded
50+
// description: Comma-separated list of label names. Fetch only issues that have any of these labels. Non existent labels are discarded.
4951
// type: string
5052
// - name: milestones
5153
// in: query
52-
// description: comma separated list of milestone names. Fetch only issues that have any of this milestones. Non existent are discarded
54+
// description: Comma-separated list of milestone names. Fetch only issues that have any of these milestones. Non existent milestones are discarded.
5355
// type: string
5456
// - name: q
5557
// in: query
56-
// description: search string
58+
// description: Search string
5759
// type: string
5860
// - name: priority_repo_id
5961
// in: query
60-
// description: repository to prioritize in the results
62+
// description: Repository ID to prioritize in the results
6163
// type: integer
6264
// format: int64
6365
// - name: type
6466
// in: query
65-
// description: filter by type (issues / pulls) if set
67+
// description: Filter by issue type
6668
// type: string
69+
// enum: [issues, pulls]
6770
// - name: since
6871
// in: query
69-
// description: Only show notifications updated after the given time. This is a timestamp in RFC 3339 format
72+
// description: Only show issues updated after the given time (RFC 3339 format)
7073
// type: string
7174
// format: date-time
72-
// required: false
7375
// - name: before
7476
// in: query
75-
// description: Only show notifications updated before the given time. This is a timestamp in RFC 3339 format
77+
// description: Only show issues updated before the given time (RFC 3339 format)
7678
// type: string
7779
// format: date-time
78-
// required: false
7980
// - name: assigned
8081
// in: query
81-
// description: filter (issues / pulls) assigned to you, default is false
82+
// description: Filter issues or pulls assigned to the authenticated user
8283
// type: boolean
84+
// default: false
8385
// - name: created
8486
// in: query
85-
// description: filter (issues / pulls) created by you, default is false
87+
// description: Filter issues or pulls created by the authenticated user
8688
// type: boolean
89+
// default: false
8790
// - name: mentioned
8891
// in: query
89-
// description: filter (issues / pulls) mentioning you, default is false
92+
// description: Filter issues or pulls mentioning the authenticated user
9093
// type: boolean
94+
// default: false
9195
// - name: review_requested
9296
// in: query
93-
// description: filter pulls requesting your review, default is false
97+
// description: Filter pull requests where the authenticated user's review was requested
9498
// type: boolean
99+
// default: false
95100
// - name: reviewed
96101
// in: query
97-
// description: filter pulls reviewed by you, default is false
102+
// description: Filter pull requests reviewed by the authenticated user
98103
// type: boolean
104+
// default: false
99105
// - name: owner
100106
// in: query
101-
// description: filter by owner
107+
// description: Filter by repository owner
102108
// type: string
103109
// - name: team
104110
// in: query
105-
// description: filter by team (requires organization owner parameter to be provided)
111+
// description: Filter by team (requires organization owner parameter)
106112
// type: string
107113
// - name: page
108114
// in: query
109-
// description: page number of results to return (1-based)
115+
// description: Page number of results to return (1-based)
110116
// type: integer
117+
// minimum: 1
118+
// default: 1
111119
// - name: limit
112120
// in: query
113-
// description: page size of results
121+
// description: Number of items per page
114122
// type: integer
123+
// minimum: 0
115124
// responses:
116125
// "200":
117126
// "$ref": "#/responses/IssueList"
127+
// "400":
128+
// "$ref": "#/responses/error"
129+
// "422":
130+
// "$ref": "#/responses/validationError"
118131

119132
before, since, err := context.GetQueryBeforeSince(ctx.Base)
120133
if err != nil {

templates/swagger/v1_json.tmpl

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

0 commit comments

Comments
 (0)