summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorCyborus <cyborus@cyborus.xyz>2024-07-30 21:46:52 +0200
committerCyborus <cyborus@cyborus.xyz>2024-07-30 21:46:52 +0200
commit3fa4cf8f0ec33faa082e7b04c2d7d2d0e0543e24 (patch)
tree7c894d755981ec523e9613c8b76c405b35b6de29 /generator
parentMerge pull request 'bump version to 0.4.0' (#70) from bump-0.4.0 into main (diff)
downloadforgejo-api-3fa4cf8f0ec33faa082e7b04c2d7d2d0e0543e24.tar.xz
forgejo-api-3fa4cf8f0ec33faa082e7b04c2d7d2d0e0543e24.zip
docs: replace instances of "gitea" with "Forgejo"
Diffstat (limited to 'generator')
-rw-r--r--generator/src/methods.rs3
-rw-r--r--generator/src/structs.rs2
2 files changed, 5 insertions, 0 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("/// ");