global: MASSIVE snapshot

This commit is contained in:
nym21
2026-01-07 01:16:37 +01:00
parent e832ffbe23
commit cb0abc324e
487 changed files with 21155 additions and 13627 deletions

View File

@@ -2,7 +2,7 @@
use std::fmt::Write;
use crate::{Endpoint, Parameter, to_camel_case};
use crate::{Endpoint, Parameter, generators::MANUAL_GENERIC_TYPES, to_camel_case};
/// Generate API methods for the BrkClient class.
pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) {
@@ -12,7 +12,7 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) {
}
let method_name = endpoint_to_method_name(endpoint);
let return_type = endpoint.response_type.as_deref().unwrap_or("*");
let return_type = normalize_return_type(endpoint.response_type.as_deref().unwrap_or("*"));
writeln!(output, " /**").unwrap();
if let Some(summary) = &endpoint.summary {
@@ -110,3 +110,12 @@ fn build_path_template(path: &str, path_params: &[Parameter]) -> String {
}
result
}
/// Replace generic types with their Any variants in return types.
fn normalize_return_type(return_type: &str) -> String {
let mut result = return_type.to_string();
for type_name in MANUAL_GENERIC_TYPES {
result = result.replace(type_name, &format!("Any{}", type_name));
}
result
}