From d40f40b9af75782dad15f83b61330b3dac4ed232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Fri, 17 Mar 2023 15:53:22 +0100 Subject: [PATCH] httpd: Use camelCase in query params MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's more ergonomic to consume in JS/TS. Signed-off-by: Rūdolfs Ošiņš --- radicle-httpd/src/api.rs | 2 +- radicle-httpd/src/api/v1/projects.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/radicle-httpd/src/api.rs b/radicle-httpd/src/api.rs index 883426be..84488ec3 100644 --- a/radicle-httpd/src/api.rs +++ b/radicle-httpd/src/api.rs @@ -109,7 +109,7 @@ async fn root_handler() -> impl IntoResponse { } #[derive(Serialize, Deserialize, Clone)] -#[serde(rename_all = "kebab-case")] +#[serde(rename_all = "camelCase")] pub struct PaginationQuery { pub page: Option, pub per_page: Option, diff --git a/radicle-httpd/src/api/v1/projects.rs b/radicle-httpd/src/api/v1/projects.rs index 8ff92a58..13026832 100644 --- a/radicle-httpd/src/api/v1/projects.rs +++ b/radicle-httpd/src/api/v1/projects.rs @@ -114,7 +114,7 @@ async fn project_handler(State(ctx): State, Path(id): Path) -> impl } #[derive(Serialize, Deserialize, Clone)] -#[serde(rename_all = "kebab-case")] +#[serde(rename_all = "camelCase")] pub struct CommitsQueryString { pub parent: Option, pub since: Option,