fix(api): use query params, not path params for Update & Delete Bucket

This commit is contained in:
Milas Bowman
2025-08-23 13:02:03 -04:00
parent 17c73bafa2
commit 4deb57815a
2 changed files with 7 additions and 8 deletions
+5 -2
View File
@@ -891,9 +891,11 @@ pub struct CreateBucketLocalAlias {
// ---- UpdateBucket ---- // ---- UpdateBucket ----
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize, IntoParams)]
#[into_params(parameter_in = Query)]
pub struct UpdateBucketRequest { pub struct UpdateBucketRequest {
pub id: String, pub id: String,
#[param(ignore = true)]
pub body: UpdateBucketRequestBody, pub body: UpdateBucketRequestBody,
} }
@@ -917,7 +919,8 @@ pub struct UpdateBucketWebsiteAccess {
// ---- DeleteBucket ---- // ---- DeleteBucket ----
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize, IntoParams)]
#[into_params(parameter_in = Query)]
pub struct DeleteBucketRequest { pub struct DeleteBucketRequest {
pub id: String, pub id: String,
} }
+2 -6
View File
@@ -478,9 +478,7 @@ In `quotas`: new values of `maxSize` and `maxObjects` must both be specified, or
to remove the quotas. An absent value will be considered the same as a `null`. It is not possible to remove the quotas. An absent value will be considered the same as a `null`. It is not possible
to change only one of the two quotas. to change only one of the two quotas.
", ",
params( params(UpdateBucketRequest),
("id" = String, description = "ID of the bucket to update"),
),
request_body = UpdateBucketRequestBody, request_body = UpdateBucketRequestBody,
responses( responses(
(status = 200, description = "Bucket has been updated", body = UpdateBucketResponse), (status = 200, description = "Bucket has been updated", body = UpdateBucketResponse),
@@ -498,9 +496,7 @@ Deletes a storage bucket. A bucket cannot be deleted if it is not empty.
**Warning:** this will delete all aliases associated with the bucket! **Warning:** this will delete all aliases associated with the bucket!
", ",
params( params(DeleteBucketRequest),
("id" = String, description = "ID of the bucket to delete"),
),
responses( responses(
(status = 200, description = "Bucket has been deleted"), (status = 200, description = "Bucket has been deleted"),
(status = 400, description = "Bucket is not empty"), (status = 400, description = "Bucket is not empty"),