From f90868c595396f8b46c7cd78eeae97a8a3bb160c Mon Sep 17 00:00:00 2001 From: kolaente Date: Fri, 5 Jun 2026 10:06:26 +0200 Subject: [PATCH] docs(models): tag TaskAssignee fields for the v2 schema Add doc: tags so Huma can describe user_id and created in the /api/v2 OpenAPI spec (it can't read Go comments), mark the server-set created field readOnly, and give it an explicit json:"created" tag so it serializes in snake_case like the rest of the v2 surface. --- pkg/models/task_assignees.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/models/task_assignees.go b/pkg/models/task_assignees.go index 567341844..6324c5223 100644 --- a/pkg/models/task_assignees.go +++ b/pkg/models/task_assignees.go @@ -32,8 +32,8 @@ import ( type TaskAssginee struct { ID int64 `xorm:"bigint autoincr not null unique pk" json:"-"` TaskID int64 `xorm:"bigint INDEX not null" json:"-" param:"projecttask"` - UserID int64 `xorm:"bigint INDEX not null" json:"user_id" param:"user"` - Created time.Time `xorm:"created not null"` + UserID int64 `xorm:"bigint INDEX not null" json:"user_id" param:"user" doc:"The id of the user to assign to the task. The user must have access to the task's project."` + Created time.Time `xorm:"created not null" json:"created" readOnly:"true" doc:"A timestamp when this assignment was created. You cannot change this value."` web.CRUDable `xorm:"-" json:"-"` web.Permissions `xorm:"-" json:"-"`