API: Add missing Swagger endpoint annotations and update swagger.json

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-09-22 04:12:02 +02:00
parent c8964fdc6b
commit 578fbe4d10
17 changed files with 2394 additions and 86 deletions

View File

@@ -12,11 +12,17 @@ import (
"github.com/photoprism/photoprism/pkg/service/http/header"
)
// GetSession returns the session data as JSON if authentication was successful.
// GetSession returns session data for the current or specified session.
//
// GET /api/v1/session
// GET /api/v1/session/:id
// GET /api/v1/sessions/:id
// @Summary get the current session or a session by id
// @Tags Authentication
// @Produce json
// @Param id path string false "session id"
// @Success 200 {object} gin.H
// @Failure 401,403,404,429 {object} i18n.Response
// @Router /api/v1/session [get]
// @Router /api/v1/session/{id} [get]
// @Router /api/v1/sessions/{id} [get]
func GetSession(router *gin.RouterGroup) {
getSessionHandler := func(c *gin.Context) {
// Prevent CDNs from caching this endpoint.