summaryrefslogtreecommitdiffstats
path: root/generator/src/methods.rs
diff options
context:
space:
mode:
authorCyborus <cyborus@cyborus.xyz>2024-02-10 05:28:23 +0100
committerCyborus <cyborus@cyborus.xyz>2024-02-10 05:28:23 +0100
commit7938d81544efa9159646dc10bd9b7699b438c983 (patch)
tree52afae5ec9b239100af2d1bba6019109ad671a1d /generator/src/methods.rs
parentfix warnings (diff)
downloadforgejo-api-7938d81544efa9159646dc10bd9b7699b438c983.tar.xz
forgejo-api-7938d81544efa9159646dc10bd9b7699b438c983.zip
split generation into method and struct files
Diffstat (limited to 'generator/src/methods.rs')
-rw-r--r--generator/src/methods.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/generator/src/methods.rs b/generator/src/methods.rs
index 70ebe99..c0f614c 100644
--- a/generator/src/methods.rs
+++ b/generator/src/methods.rs
@@ -6,6 +6,8 @@ use std::fmt::Write;
pub fn create_methods(spec: &OpenApiV2) -> eyre::Result<String> {
let mut s = String::new();
s.push_str("use crate::ForgejoError;\n");
+ s.push_str("use super::structs::*;\n");
+ s.push_str("\n");
s.push_str("impl crate::Forgejo {\n");
for (path, item) in &spec.paths {
s.push_str(&create_methods_for_path(&spec, path, item).wrap_err_with(|| path.clone())?);