From da76d393d93623ea596226e7b4dd62b0bd8e8f9b Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 9 Jun 2026 21:34:41 +0200 Subject: [PATCH] docs(api/v2): tag task relation fields for the v2 schema --- pkg/models/task_relation.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/models/task_relation.go b/pkg/models/task_relation.go index 58280c5ee..392ea2ef4 100644 --- a/pkg/models/task_relation.go +++ b/pkg/models/task_relation.go @@ -81,18 +81,19 @@ type TaskRelation struct { // The unique, numeric id of this relation. ID int64 `xorm:"bigint autoincr not null unique pk" json:"-"` // The ID of the "base" task, the task which has a relation to another. - TaskID int64 `xorm:"bigint not null" json:"task_id" param:"task"` + TaskID int64 `xorm:"bigint not null" json:"task_id" param:"task" readOnly:"true" doc:"The id of the base task. Set from the URL path; ignored in the request body."` // The ID of the other task, the task which is being related. - OtherTaskID int64 `xorm:"bigint not null" json:"other_task_id" param:"otherTask"` + OtherTaskID int64 `xorm:"bigint not null" json:"other_task_id" param:"otherTask" doc:"The id of the other task this relation points to."` // The kind of the relation. - RelationKind RelationKind `xorm:"varchar(50) not null" json:"relation_kind" param:"relationKind"` + // The enum list must stay in sync with RelationKind.isValid() (RelationKindUnknown excluded); the v2 delete route param repeats it. + RelationKind RelationKind `xorm:"varchar(50) not null" json:"relation_kind" param:"relationKind" enum:"subtask,parenttask,related,duplicateof,duplicates,blocking,blocked,precedes,follows,copiedfrom,copiedto" doc:"The kind of relation, describing the direction from the base task to the other task (e.g. subtask, blocking, related). The inverse relation is created automatically."` CreatedByID int64 `xorm:"bigint not null" json:"-"` // The user who created this relation - CreatedBy *user.User `xorm:"-" json:"created_by"` + CreatedBy *user.User `xorm:"-" json:"created_by" readOnly:"true" doc:"The user who created this relation."` // A timestamp when this label was created. You cannot change this value. - Created time.Time `xorm:"created not null" json:"created"` + Created time.Time `xorm:"created not null" json:"created" readOnly:"true" doc:"A timestamp when this relation was created. You cannot change this value."` web.CRUDable `xorm:"-" json:"-"` web.Permissions `xorm:"-" json:"-"`