diff --git a/api/swagger.yml b/api/swagger.yml
index 6fd84402582..d6b38d3923c 100644
--- a/api/swagger.yml
+++ b/api/swagger.yml
@@ -3299,6 +3299,8 @@ paths:
responses:
204:
description: reset successful
+ 400:
+ $ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthorized"
403:
diff --git a/clients/java-legacy/api/openapi.yaml b/clients/java-legacy/api/openapi.yaml
index d04777b1e2c..a730b7e32da 100644
--- a/clients/java-legacy/api/openapi.yaml
+++ b/clients/java-legacy/api/openapi.yaml
@@ -3234,6 +3234,12 @@ paths:
responses:
"204":
description: reset successful
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ description: Bad Request
"401":
content:
application/json:
diff --git a/clients/java-legacy/docs/BranchesApi.md b/clients/java-legacy/docs/BranchesApi.md
index 2856f19584f..c1a1fc02597 100644
--- a/clients/java-legacy/docs/BranchesApi.md
+++ b/clients/java-legacy/docs/BranchesApi.md
@@ -690,6 +690,7 @@ null (empty response body)
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | reset successful | - |
+**400** | Bad Request | - |
**401** | Unauthorized | - |
**403** | Forbidden | - |
**404** | Resource Not Found | - |
diff --git a/clients/java-legacy/src/main/java/io/lakefs/clients/api/BranchesApi.java b/clients/java-legacy/src/main/java/io/lakefs/clients/api/BranchesApi.java
index 01dbde73887..a72c0b7cf50 100644
--- a/clients/java-legacy/src/main/java/io/lakefs/clients/api/BranchesApi.java
+++ b/clients/java-legacy/src/main/java/io/lakefs/clients/api/BranchesApi.java
@@ -988,6 +988,7 @@ public okhttp3.Call listBranchesAsync(String repository, String prefix, String a
Status Code | Description | Response Headers |
204 | reset successful | - |
+ 400 | Bad Request | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Resource Not Found | - |
@@ -1062,6 +1063,7 @@ private okhttp3.Call resetBranchValidateBeforeCall(String repository, String bra
Status Code | Description | Response Headers |
204 | reset successful | - |
+ 400 | Bad Request | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Resource Not Found | - |
@@ -1085,6 +1087,7 @@ public void resetBranch(String repository, String branch, ResetCreation resetCre
Status Code | Description | Response Headers |
204 | reset successful | - |
+ 400 | Bad Request | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Resource Not Found | - |
@@ -1110,6 +1113,7 @@ public ApiResponse resetBranchWithHttpInfo(String repository, String branc
Status Code | Description | Response Headers |
204 | reset successful | - |
+ 400 | Bad Request | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Resource Not Found | - |
diff --git a/clients/java/api/openapi.yaml b/clients/java/api/openapi.yaml
index 66d4a1c6e31..ea8db7f33ca 100644
--- a/clients/java/api/openapi.yaml
+++ b/clients/java/api/openapi.yaml
@@ -3234,6 +3234,12 @@ paths:
responses:
"204":
description: reset successful
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ description: Bad Request
"401":
content:
application/json:
diff --git a/clients/java/docs/BranchesApi.md b/clients/java/docs/BranchesApi.md
index 287cf3c6768..7f46857e87b 100644
--- a/clients/java/docs/BranchesApi.md
+++ b/clients/java/docs/BranchesApi.md
@@ -705,6 +705,7 @@ null (empty response body)
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **204** | reset successful | - |
+| **400** | Bad Request | - |
| **401** | Unauthorized | - |
| **403** | Forbidden | - |
| **404** | Resource Not Found | - |
diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/BranchesApi.java b/clients/java/src/main/java/io/lakefs/clients/sdk/BranchesApi.java
index 9cd8f09f868..4a78a796eca 100644
--- a/clients/java/src/main/java/io/lakefs/clients/sdk/BranchesApi.java
+++ b/clients/java/src/main/java/io/lakefs/clients/sdk/BranchesApi.java
@@ -1419,6 +1419,7 @@ private APIresetBranchRequest(String repository, String branch, ResetCreation re
Status Code | Description | Response Headers |
204 | reset successful | - |
+ 400 | Bad Request | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Resource Not Found | - |
@@ -1437,6 +1438,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
Status Code | Description | Response Headers |
204 | reset successful | - |
+ 400 | Bad Request | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Resource Not Found | - |
@@ -1456,6 +1458,7 @@ public void execute() throws ApiException {
Status Code | Description | Response Headers |
204 | reset successful | - |
+ 400 | Bad Request | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Resource Not Found | - |
@@ -1476,6 +1479,7 @@ public ApiResponse executeWithHttpInfo() throws ApiException {
Status Code | Description | Response Headers |
204 | reset successful | - |
+ 400 | Bad Request | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Resource Not Found | - |
@@ -1499,6 +1503,7 @@ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiEx
Status Code | Description | Response Headers |
204 | reset successful | - |
+ 400 | Bad Request | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Resource Not Found | - |
diff --git a/clients/python-legacy/docs/BranchesApi.md b/clients/python-legacy/docs/BranchesApi.md
index c75fa98b3e9..4ca22c175ee 100644
--- a/clients/python-legacy/docs/BranchesApi.md
+++ b/clients/python-legacy/docs/BranchesApi.md
@@ -838,6 +838,7 @@ void (empty response body)
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | reset successful | - |
+**400** | Bad Request | - |
**401** | Unauthorized | - |
**403** | Forbidden | - |
**404** | Resource Not Found | - |
diff --git a/clients/python/docs/BranchesApi.md b/clients/python/docs/BranchesApi.md
index 948fd2174f4..33c09474b8f 100644
--- a/clients/python/docs/BranchesApi.md
+++ b/clients/python/docs/BranchesApi.md
@@ -812,6 +812,7 @@ void (empty response body)
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | reset successful | - |
+**400** | Bad Request | - |
**401** | Unauthorized | - |
**403** | Forbidden | - |
**404** | Resource Not Found | - |
diff --git a/docs/assets/js/swagger.yml b/docs/assets/js/swagger.yml
index 6fd84402582..d6b38d3923c 100644
--- a/docs/assets/js/swagger.yml
+++ b/docs/assets/js/swagger.yml
@@ -3299,6 +3299,8 @@ paths:
responses:
204:
description: reset successful
+ 400:
+ $ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthorized"
403:
diff --git a/pkg/api/controller.go b/pkg/api/controller.go
index 52ae19a4b08..696b38deb4e 100644
--- a/pkg/api/controller.go
+++ b/pkg/api/controller.go
@@ -2338,7 +2338,8 @@ func (c *Controller) ResetBranch(w http.ResponseWriter, r *http.Request, body ap
case entryTypeObject:
err = c.Catalog.ResetEntry(ctx, repository, branch, swag.StringValue(body.Path), graveler.WithForce(swag.BoolValue(body.Force)))
default:
- writeError(w, r, http.StatusNotFound, "reset type not found")
+ writeError(w, r, http.StatusBadRequest, "unknown reset type")
+ return
}
if c.handleAPIError(ctx, w, r, err) {
return