From 9b6e45ca1fb78c8ff6a8601d858c9e80fc87ec41 Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Thu, 19 Jun 2025 22:31:44 +0200 Subject: [PATCH 1/2] fix(openapi): set parameters in query instead of path for get params get request params are wrongfully outputted as "in path" instead of "in query", it fix this. Fixes #1081 --- src/api/admin/api.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/admin/api.rs b/src/api/admin/api.rs index cfeb9e2e..d2faa618 100644 --- a/src/api/admin/api.rs +++ b/src/api/admin/api.rs @@ -308,6 +308,7 @@ pub struct ListAdminTokensResponse(pub Vec); // ---- GetAdminTokenInfo ---- #[derive(Debug, Clone, Serialize, Deserialize, IntoParams)] +#[into_params(parameter_in = Query)] #[serde(rename_all = "camelCase")] pub struct GetAdminTokenInfoRequest { /// Admin API token ID @@ -648,6 +649,7 @@ pub struct ListKeysResponseItem { // ---- GetKeyInfo ---- #[derive(Debug, Clone, Serialize, Deserialize, IntoParams)] +#[into_params(parameter_in = Query)] #[serde(rename_all = "camelCase")] pub struct GetKeyInfoRequest { /// Access key ID @@ -790,6 +792,7 @@ pub struct BucketLocalAlias { // ---- GetBucketInfo ---- #[derive(Debug, Clone, Serialize, Deserialize, IntoParams)] +#[into_params(parameter_in = Query)] #[serde(rename_all = "camelCase")] pub struct GetBucketInfoRequest { /// Exact bucket ID to look up @@ -928,6 +931,7 @@ pub struct CleanupIncompleteUploadsResponse { } #[derive(Debug, Clone, Serialize, Deserialize, IntoParams)] +#[into_params(parameter_in = Query)] #[serde(rename_all = "camelCase")] pub struct InspectObjectRequest { pub bucket_id: String, From 56a23d936e2738123933c3fb29c071aef42ce6cf Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Thu, 19 Jun 2025 23:55:00 +0200 Subject: [PATCH 2/2] chore: regenerate openapi spec v2 --- doc/api/garage-admin-v2.json | 71 +++++++++++++----------------------- 1 file changed, 25 insertions(+), 46 deletions(-) diff --git a/doc/api/garage-admin-v2.json b/doc/api/garage-admin-v2.json index e4b5a84a..d9b2622a 100644 --- a/doc/api/garage-admin-v2.json +++ b/doc/api/garage-admin-v2.json @@ -567,26 +567,20 @@ "parameters": [ { "name": "id", - "in": "path", + "in": "query", "description": "Admin API token ID", - "required": true, + "required": false, "schema": { - "type": [ - "string", - "null" - ] + "type": "string" } }, { "name": "search", - "in": "path", + "in": "query", "description": "Partial token ID or name to search for", - "required": true, + "required": false, "schema": { - "type": [ - "string", - "null" - ] + "type": "string" } } ], @@ -662,38 +656,29 @@ "parameters": [ { "name": "id", - "in": "path", + "in": "query", "description": "Exact bucket ID to look up", - "required": true, + "required": false, "schema": { - "type": [ - "string", - "null" - ] + "type": "string" } }, { "name": "globalAlias", - "in": "path", + "in": "query", "description": "Global alias of bucket to look up", - "required": true, + "required": false, "schema": { - "type": [ - "string", - "null" - ] + "type": "string" } }, { "name": "search", - "in": "path", + "in": "query", "description": "Partial ID or alias to search for", - "required": true, + "required": false, "schema": { - "type": [ - "string", - "null" - ] + "type": "string" } } ], @@ -841,33 +826,27 @@ "parameters": [ { "name": "id", - "in": "path", + "in": "query", "description": "Access key ID", - "required": true, + "required": false, "schema": { - "type": [ - "string", - "null" - ] + "type": "string" } }, { "name": "search", - "in": "path", + "in": "query", "description": "Partial key ID or name to search for", - "required": true, + "required": false, "schema": { - "type": [ - "string", - "null" - ] + "type": "string" } }, { "name": "showSecretKey", - "in": "path", + "in": "query", "description": "Whether to return the secret access key", - "required": true, + "required": false, "schema": { "type": "boolean" } @@ -1094,7 +1073,7 @@ "parameters": [ { "name": "bucketId", - "in": "path", + "in": "query", "required": true, "schema": { "type": "string" @@ -1102,7 +1081,7 @@ }, { "name": "key", - "in": "path", + "in": "query", "required": true, "schema": { "type": "string"