feat(app) lab 3 implemented

This commit is contained in:
imadev
2026-10-30 18:11:30 +03:00
parent f731f9b460
commit 48a616e910
57 changed files with 1390 additions and 303 deletions
-9
View File
@@ -9,15 +9,6 @@ import (
"github.com/gofiber/fiber/v3"
)
// AGENT: Field-level validation is deliberately not delegated to a generic
// struct validator. The contract needs specific messages for blank strings,
// Unicode length and duplicate member IDs, so handlers call the Validators in
// validation.go after this strict JSON decoding step.
//
// BindJSON enforces the request format from the contract: JSON content type,
// exactly one JSON value, no unknown fields and correct Go types. Field-level
// rules (non-blank strings, lengths, UUID lists) stay in the handlers so their
// messages can be specific.
func BindJSON(c fiber.Ctx, dst any) error {
if contentType := c.Get(fiber.HeaderContentType); !strings.HasPrefix(contentType, "application/json") {
return UnsupportedMedia("invalid JSON body")