mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 20:38:08 +08:00
fix: added swagger doc generation for mgmt and userprefs (#1530)
Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com>
This commit is contained in:
committed by
GitHub
parent
fc6d6356fb
commit
aa16c955b3
@@ -70,6 +70,14 @@ type mgmt struct {
|
||||
log log.Logger
|
||||
}
|
||||
|
||||
// mgmtHandler godoc
|
||||
// @Summary Get current server configuration
|
||||
// @Description Get current server configuration
|
||||
// @Router /v2/_zot/ext/mgmt [get]
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} extensions.StrippedConfig
|
||||
// @Failure 500 {string} string "internal server error".
|
||||
func (mgmt *mgmt) handler() http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
sanitizedConfig := mgmt.config.Sanitize()
|
||||
|
||||
@@ -43,6 +43,19 @@ func SetupUserPreferencesRoutes(config *config.Config, router *mux.Router, store
|
||||
}
|
||||
}
|
||||
|
||||
// ListTags godoc
|
||||
// @Summary Add bookmarks/stars info
|
||||
// @Description Add bookmarks/stars info
|
||||
// @Router /v2/_zot/ext/userprefs [put]
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param action query string true "specify action" Enums("toggleBookmark", "toggleStar")
|
||||
// @Param repo query string true "repository name"
|
||||
// @Success 200 {string} string "ok"
|
||||
// @Failure 404 {string} string "not found"
|
||||
// @Failure 403 {string} string "forbidden"
|
||||
// @Failure 500 {string} string "internal server error"
|
||||
// @Failure 400 {string} string "bad request".
|
||||
func HandleUserPrefs(repoDB repodb.RepoDB, log log.Logger) func(w http.ResponseWriter, r *http.Request) {
|
||||
return func(rsp http.ResponseWriter, req *http.Request) {
|
||||
if !queryHasParams(req.URL.Query(), []string{"action"}) {
|
||||
|
||||
Reference in New Issue
Block a user