From 66d76d7ab26a69b176f7c8ce5788a53c106e0491 Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Wed, 7 Dec 2022 18:01:47 +0100 Subject: [PATCH] radicle: Use `defaultBranch` for payload key This was changed by mistake from the previous format used in radicle link. We restore all keys to camel-case. Signed-off-by: Alexis Sellier --- radicle-cli/examples/rad-init.md | 6 +++--- radicle/src/identity/project.rs | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/radicle-cli/examples/rad-init.md b/radicle-cli/examples/rad-init.md index bcf9b400..b8719090 100644 --- a/radicle-cli/examples/rad-init.md +++ b/radicle-cli/examples/rad-init.md @@ -11,11 +11,11 @@ ok Project heartwood created { "name": "heartwood", "description": "Radicle Heartwood Protocol & Stack", - "default-branch": "master" + "defaultBranch": "master" } -Your project id is rad:zb2rNRYmmz7SLZ7xMjM7dddswC3K. You can show it any time by running: +Your project id is rad:z2TBtGrJKGsremYAPec6vN4n77Ba7. You can show it any time by running: rad . To publish your project to the network, run: @@ -27,5 +27,5 @@ Projects can be listed with the `ls` command: ``` $ rad ls -heartwood rad:zb2rNRYmmz7SLZ7xMjM7dddswC3K cdf76ce Radicle Heartwood Protocol & Stack +heartwood rad:z2TBtGrJKGsremYAPec6vN4n77Ba7 cdf76ce Radicle Heartwood Protocol & Stack ``` diff --git a/radicle/src/identity/project.rs b/radicle/src/identity/project.rs index 38755ea3..2cd2fe3f 100644 --- a/radicle/src/identity/project.rs +++ b/radicle/src/identity/project.rs @@ -69,11 +69,11 @@ impl DocError { } #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -#[serde(rename_all = "kebab-case")] +#[serde(rename_all = "camelCase")] pub struct Payload { pub name: String, - pub description: String, // TODO: Make optional. - pub default_branch: git::RefString, // TODO: Make optional. + pub description: String, + pub default_branch: git::RefString, } #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)] @@ -82,6 +82,7 @@ pub struct Payload { pub struct Namespace(String); #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct Doc { #[serde(rename = "xyz.radicle.project")] pub payload: Payload, @@ -501,7 +502,7 @@ mod test { ); assert_eq!( id.to_human(), - String::from("rad:zb2rNRYmmz7SLZ7xMjM7dddswC3K") + String::from("rad:z2TBtGrJKGsremYAPec6vN4n77Ba7") ); }