diff options
author | Cyborus <cyborus@noreply.codeberg.org> | 2024-07-30 21:49:35 +0200 |
---|---|---|
committer | Cyborus <cyborus@noreply.codeberg.org> | 2024-07-30 21:49:35 +0200 |
commit | 127e4e6a9ccea0793e760bbcb604ca3298acefef (patch) | |
tree | 7c894d755981ec523e9613c8b76c405b35b6de29 | |
parent | Merge pull request 'bump version to 0.4.0' (#70) from bump-0.4.0 into main (diff) | |
parent | docs: replace instances of "gitea" with "Forgejo" (diff) | |
download | forgejo-api-127e4e6a9ccea0793e760bbcb604ca3298acefef.tar.xz forgejo-api-127e4e6a9ccea0793e760bbcb604ca3298acefef.zip |
Merge pull request 'replace instances of "gitea" with "Forgejo"' (#71) from replace-gitea into mainv0.4.0
Reviewed-on: https://codeberg.org/Cyborus/forgejo-api/pulls/71
-rw-r--r-- | generator/src/methods.rs | 3 | ||||
-rw-r--r-- | generator/src/structs.rs | 2 | ||||
-rw-r--r-- | src/generated/methods.rs | 4 | ||||
-rw-r--r-- | src/generated/structs.rs | 2 |
4 files changed, 8 insertions, 3 deletions
diff --git a/generator/src/methods.rs b/generator/src/methods.rs index 93d5f57..7245247 100644 --- a/generator/src/methods.rs +++ b/generator/src/methods.rs @@ -96,6 +96,9 @@ fn method_docs(spec: &OpenApiV2, op: &Operation) -> eyre::Result<String> { let mut out = String::new(); let mut prev = false; if let Some(summary) = &op.summary { + let summary = summary + .replace("gitea", "Forgejo") + .replace("Gitea", "Forgejo"); write!(&mut out, "/// {summary}\n")?; prev = true; } diff --git a/generator/src/structs.rs b/generator/src/structs.rs index 4bd4418..4543f5c 100644 --- a/generator/src/structs.rs +++ b/generator/src/structs.rs @@ -104,6 +104,7 @@ pub fn create_struct_for_definition( } if let MaybeRef::Value { value } = &prop_schema { if let Some(desc) = &value.description { + let desc = desc.replace("gitea", "Forgejo").replace("Gitea", "Forgejo"); for line in desc.lines() { fields.push_str("/// "); fields.push_str(line); @@ -199,6 +200,7 @@ fn create_struct_docs(schema: &Schema) -> eyre::Result<String> { fn create_struct_docs_str(description: Option<&str>) -> eyre::Result<String> { let doc = match description { Some(desc) => { + let desc = desc.replace("gitea", "Forgejo").replace("Gitea", "Forgejo"); let mut out = String::new(); for line in desc.lines() { out.push_str("/// "); diff --git a/src/generated/methods.rs b/src/generated/methods.rs index b9657c5..2b23abf 100644 --- a/src/generated/methods.rs +++ b/src/generated/methods.rs @@ -548,7 +548,7 @@ impl crate::Forgejo { } } - /// Returns the nodeinfo of the Gitea application + /// Returns the nodeinfo of the Forgejo application pub async fn get_node_info(&self) -> Result<NodeInfo, ForgejoError> { let request = self.get("nodeinfo").build()?; let response = self.execute(request).await?; @@ -8066,7 +8066,7 @@ impl crate::Forgejo { } } - /// Returns the version of the Gitea application + /// Returns the version of the Forgejo application pub async fn get_version(&self) -> Result<ServerVersion, ForgejoError> { let request = self.get("version").build()?; let response = self.execute(request).await?; diff --git a/src/generated/structs.rs b/src/generated/structs.rs index 48d1326..7399273 100644 --- a/src/generated/structs.rs +++ b/src/generated/structs.rs @@ -2735,7 +2735,7 @@ pub struct User { /// the user's full name pub full_name: Option<String>, #[serde(deserialize_with = "crate::none_if_blank_url")] - /// URL to the user's gitea page + /// URL to the user's Forgejo page pub html_url: Option<url::Url>, /// the user's id pub id: Option<i64>, |