From 936376127314de0b2a162f9a27b26a5faa1600ad Mon Sep 17 00:00:00 2001 From: vansangpfiev Date: Mon, 7 Oct 2024 15:31:50 +0700 Subject: [PATCH] chore: change update to patch for models update (#1444) * chore: change update to patch * fix: swagger --- engine/controllers/models.h | 4 ++-- engine/controllers/swagger.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/controllers/models.h b/engine/controllers/models.h index c2c804170..167d4bb36 100644 --- a/engine/controllers/models.h +++ b/engine/controllers/models.h @@ -14,7 +14,7 @@ class Models : public drogon::HttpController { METHOD_ADD(Models::PullModel, "/pull", Post); METHOD_ADD(Models::ListModel, "", Get); METHOD_ADD(Models::GetModel, "/{1}", Get); - METHOD_ADD(Models::UpdateModel, "/{1}", Post); + METHOD_ADD(Models::UpdateModel, "/{1}", Patch); METHOD_ADD(Models::ImportModel, "/import", Post); METHOD_ADD(Models::DeleteModel, "/{1}", Delete); METHOD_ADD(Models::SetModelAlias, "/alias", Post); @@ -24,7 +24,7 @@ class Models : public drogon::HttpController { ADD_METHOD_TO(Models::PullModel, "/v1/models/pull", Post); ADD_METHOD_TO(Models::ListModel, "/v1/models", Get); ADD_METHOD_TO(Models::GetModel, "/v1/models/{1}", Get); - ADD_METHOD_TO(Models::UpdateModel, "/v1/models/{1}", Post); + ADD_METHOD_TO(Models::UpdateModel, "/v1/models/{1}", Patch); ADD_METHOD_TO(Models::ImportModel, "/v1/models/import", Post); ADD_METHOD_TO(Models::DeleteModel, "/v1/models/{1}", Delete); ADD_METHOD_TO(Models::SetModelAlias, "/v1/models/alias", Post); diff --git a/engine/controllers/swagger.cc b/engine/controllers/swagger.cc index 89733b65c..27d9b7b15 100644 --- a/engine/controllers/swagger.cc +++ b/engine/controllers/swagger.cc @@ -211,7 +211,7 @@ Json::Value SwaggerController::generateOpenAPISpec() { ["message"]["type"] = "string"; // UpdateModel Endpoint - Json::Value& update = spec["paths"]["/v1/models/{model}"]["post"]; + Json::Value& update = spec["paths"]["/v1/models/{model}"]["patch"]; update["summary"] = "Update model details"; update["description"] = "Update various attributes of a model based on the ModelConfig "