Skip to content

Commit

Permalink
update: generator
Browse files Browse the repository at this point in the history
  • Loading branch information
nanato12 committed Dec 1, 2023
1 parent 171fc37 commit 1eb9add
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fn fix_openapi_webhook(file_path: &Path) {
}

fn fix_openapi_manage_audience(file_path: &Path) {
let mut replacements: HashMap<&str, &str> = [
let replacements: HashMap<&str, &str> = [
(
"status: Option<AudienceGroupStatus>",
"status: Option<crate::models::AudienceGroupStatus>",
Expand All @@ -77,6 +77,18 @@ fn fix_openapi_manage_audience(file_path: &Path) {
.cloned()
.collect();

replace_in_file(file_path, replacements);
}

fn fix_openapi_messaging_api(file_path: &Path) {
let mut replacements: HashMap<&str, &str> = [(
"pub enum AreaDemographic",
"#[allow(non_camel_case_types)]\npub enum AreaDemographic",
)]
.iter()
.cloned()
.collect();

let p = file_path.to_str().unwrap();

// delete type from event, source, message_content
Expand All @@ -89,19 +101,6 @@ fn fix_openapi_manage_audience(file_path: &Path) {
replacements.insert("/// Type of message", "");
}
}

replace_in_file(file_path, replacements);
}

fn fix_openapi_messaging_api(file_path: &Path) {
let replacements: HashMap<&str, &str> = [(
"pub enum AreaDemographic",
"#[allow(non_camel_case_types)]\npub enum AreaDemographic",
)]
.iter()
.cloned()
.collect();

replace_in_file(file_path, replacements);
}

Expand Down

0 comments on commit 1eb9add

Please sign in to comment.