openapi: fix query parameters (fix #1160)

This commit is contained in:
Alex Auvolat
2025-09-14 17:25:04 +02:00
parent 3148fa3afe
commit 7a256b2ebb
3 changed files with 62 additions and 73 deletions
+26 -5
View File
@@ -145,6 +145,13 @@ pub struct MultiResponse<RB> {
pub error: HashMap<String, String>,
}
#[derive(Debug, Clone, Serialize, Deserialize, IntoParams)]
#[into_params(parameter_in = Query)]
pub struct MultiRequestQueryParams {
/// Node ID to query, or `*` for all nodes, or `self` for the node responding to the request
pub node: String,
}
// **********************************************
// Special endpoints
//
@@ -155,8 +162,10 @@ pub struct MultiResponse<RB> {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OptionsRequest;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, IntoParams)]
#[into_params(parameter_in = Query)]
pub struct CheckDomainRequest {
/// The domain name to check for
pub domain: String,
}
@@ -355,9 +364,12 @@ pub struct CreateAdminTokenResponse {
// ---- UpdateAdminToken ----
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, IntoParams)]
#[into_params(parameter_in = Query)]
pub struct UpdateAdminTokenRequest {
/// Admin API token ID
pub id: String,
#[param(ignore = true)]
pub body: UpdateAdminTokenRequestBody,
}
@@ -384,8 +396,10 @@ pub struct UpdateAdminTokenResponse(pub GetAdminTokenInfoResponse);
// ---- DeleteAdminToken ----
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, IntoParams)]
#[into_params(parameter_in = Query)]
pub struct DeleteAdminTokenRequest {
/// Admin API token ID
pub id: String,
}
@@ -736,9 +750,12 @@ pub struct ImportKeyResponse(pub GetKeyInfoResponse);
// ---- UpdateKey ----
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, IntoParams)]
#[into_params(parameter_in = Query)]
pub struct UpdateKeyRequest {
/// Access key ID
pub id: String,
#[param(ignore = true)]
pub body: UpdateKeyRequestBody,
}
@@ -763,8 +780,10 @@ pub struct UpdateKeyRequestBody {
// ---- DeleteKey ----
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, IntoParams)]
#[into_params(parameter_in = Query)]
pub struct DeleteKeyRequest {
/// Access key ID
pub id: String,
}
@@ -894,6 +913,7 @@ pub struct CreateBucketLocalAlias {
#[derive(Debug, Clone, Serialize, Deserialize, IntoParams)]
#[into_params(parameter_in = Query)]
pub struct UpdateBucketRequest {
/// ID of the bucket to update
pub id: String,
#[param(ignore = true)]
pub body: UpdateBucketRequestBody,
@@ -922,6 +942,7 @@ pub struct UpdateBucketWebsiteAccess {
#[derive(Debug, Clone, Serialize, Deserialize, IntoParams)]
#[into_params(parameter_in = Query)]
pub struct DeleteBucketRequest {
/// ID of the bucket to delete
pub id: String,
}