Correct swagger annotations for enums, status codes, and notification state (#37030)

## ⚠️ BREAKING ⚠️

- delete reaction endpoints is changed to return 204 No Content rather
than 200 with no content.

## Summary

Add swagger:enum annotations and migrate all enum comments from the
deprecated comma-separated format to JSON arrays. Introduce
NotifySubjectStateType with open/closed/merged values. Fix delete
reaction endpoints to return 204 instead of 200.
This commit is contained in:
Myers Carpenter
2026-03-29 20:28:48 -04:00
committed by GitHub
parent cbea04c1fc
commit 2633f9677d
24 changed files with 265 additions and 110 deletions
+14 -12
View File
@@ -14,6 +14,8 @@ import (
)
// StateType issue state type
//
// swagger:enum StateType
type StateType string
const (
@@ -21,10 +23,11 @@ const (
StateOpen StateType = "open"
// StateClosed pr is closed
StateClosed StateType = "closed"
// StateAll is all
StateAll StateType = "all"
)
// StateAll is a query parameter filter value, not a valid object state.
const StateAll = "all"
// PullRequestMeta PR info if an issue is a PR
type PullRequestMeta struct {
HasMerged bool `json:"merged"`
@@ -58,15 +61,11 @@ type Issue struct {
Labels []*Label `json:"labels"`
Milestone *Milestone `json:"milestone"`
// deprecated
Assignee *User `json:"assignee"`
Assignees []*User `json:"assignees"`
// Whether the issue is open or closed
//
// type: string
// enum: open,closed
State StateType `json:"state"`
IsLocked bool `json:"is_locked"`
Comments int `json:"comments"`
Assignee *User `json:"assignee"`
Assignees []*User `json:"assignees"`
State StateType `json:"state"`
IsLocked bool `json:"is_locked"`
Comments int `json:"comments"`
// swagger:strfmt date-time
Created time.Time `json:"created_at"`
// swagger:strfmt date-time
@@ -132,6 +131,8 @@ type IssueDeadline struct {
}
// IssueFormFieldType defines issue form field type, can be "markdown", "textarea", "input", "dropdown" or "checkboxes"
//
// swagger:enum IssueFormFieldType
type IssueFormFieldType string
const (
@@ -168,7 +169,8 @@ func (iff IssueFormField) VisibleInContent() bool {
}
// IssueFormFieldVisible defines issue form field visible
// swagger:model
//
// swagger:enum IssueFormFieldVisible
type IssueFormFieldVisible string
const (