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:
@@ -40,7 +40,7 @@ type NotificationSubject struct {
|
||||
// Type indicates the type of the notification subject
|
||||
Type NotifySubjectType `json:"type" binding:"In(Issue,Pull,Commit,Repository)"`
|
||||
// State indicates the current state of the notification subject
|
||||
State StateType `json:"state"`
|
||||
State NotifySubjectStateType `json:"state"`
|
||||
}
|
||||
|
||||
// NotificationCount number of unread notifications
|
||||
@@ -49,7 +49,22 @@ type NotificationCount struct {
|
||||
New int64 `json:"new"`
|
||||
}
|
||||
|
||||
// NotifySubjectStateType represents the state of a notification subject
|
||||
// swagger:enum NotifySubjectStateType
|
||||
type NotifySubjectStateType string
|
||||
|
||||
const (
|
||||
// NotifySubjectStateOpen is an open subject
|
||||
NotifySubjectStateOpen NotifySubjectStateType = "open"
|
||||
// NotifySubjectStateClosed is a closed subject
|
||||
NotifySubjectStateClosed NotifySubjectStateType = "closed"
|
||||
// NotifySubjectStateMerged is a merged pull request
|
||||
NotifySubjectStateMerged NotifySubjectStateType = "merged"
|
||||
)
|
||||
|
||||
// NotifySubjectType represent type of notification subject
|
||||
//
|
||||
// swagger:enum NotifySubjectType
|
||||
type NotifySubjectType string
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user