From 1ed65d306dd122d624ebea5fe100b3ab92e94eba Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 16 Nov 2023 13:06:53 +0100 Subject: [PATCH] fix(docs): remove duplicate paths (params) in swagger docs --- pkg/models/task_collection.go | 4 ++-- pkg/models/tasks.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/models/task_collection.go b/pkg/models/task_collection.go index d17f6cc3565..565c275b479 100644 --- a/pkg/models/task_collection.go +++ b/pkg/models/task_collection.go @@ -124,7 +124,7 @@ func getTaskFilterOptsFromCollection(tf *TaskCollection) (opts *taskSearchOption // @tags task // @Accept json // @Produce json -// @Param projectID path int true "The project ID." +// @Param id path int true "The project ID." // @Param page query int false "The page number. Used for pagination. If not provided, the first page of results is returned." // @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page." // @Param s query string false "Search tasks by task text." @@ -138,7 +138,7 @@ func getTaskFilterOptsFromCollection(tf *TaskCollection) (opts *taskSearchOption // @Security JWTKeyAuth // @Success 200 {array} models.Task "The tasks" // @Failure 500 {object} models.Message "Internal error" -// @Router /projects/{projectID}/tasks [get] +// @Router /projects/{id}/tasks [get] func (tf *TaskCollection) ReadAll(s *xorm.Session, a web.Auth, search string, page int, perPage int) (result interface{}, resultCount int, totalItems int64, err error) { // If the project id is < -1 this means we're dealing with a saved filter - in that case we get and populate the filter diff --git a/pkg/models/tasks.go b/pkg/models/tasks.go index b128a09e27d..0af84a48039 100644 --- a/pkg/models/tasks.go +++ b/pkg/models/tasks.go @@ -825,13 +825,13 @@ func createTask(s *xorm.Session, t *Task, a web.Auth, updateAssignees bool) (err // @Accept json // @Produce json // @Security JWTKeyAuth -// @Param ID path int true "The Task ID" +// @Param id path int true "The Task ID" // @Param task body models.Task true "The task object" // @Success 200 {object} models.Task "The updated task object." // @Failure 400 {object} web.HTTPError "Invalid task object provided." // @Failure 403 {object} web.HTTPError "The user does not have access to the task (aka its project)" // @Failure 500 {object} models.Message "Internal error" -// @Router /tasks/{ID} [post] +// @Router /tasks/{id} [post] // //nolint:gocyclo func (t *Task) Update(s *xorm.Session, a web.Auth) (err error) { @@ -1417,12 +1417,12 @@ func updateTaskLastUpdated(s *xorm.Session, task *Task) error { // @tags task // @Produce json // @Security JWTKeyAuth -// @Param ID path int true "Task ID" +// @Param id path int true "Task ID" // @Success 200 {object} models.Message "The created task object." // @Failure 400 {object} web.HTTPError "Invalid task ID provided." // @Failure 403 {object} web.HTTPError "The user does not have access to the project" // @Failure 500 {object} models.Message "Internal error" -// @Router /tasks/{ID} [delete] +// @Router /tasks/{id} [delete] func (t *Task) Delete(s *xorm.Session, a web.Auth) (err error) { // duplicate the task for the event