use rh_foundation::Config;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct CodegenConfig {
pub output_dir: String,
pub module_name: String,
pub with_serde: bool,
pub with_docs: bool,
pub use_macro_calls: bool,
pub type_mappings: HashMap<String, String>,
pub crate_name: Option<String>,
}
impl Default for CodegenConfig {
fn default() -> Self {
let mut type_mappings = HashMap::new();
type_mappings.insert("string".to_string(), "StringType".to_string());
type_mappings.insert("integer".to_string(), "IntegerType".to_string());
type_mappings.insert("boolean".to_string(), "BooleanType".to_string());
type_mappings.insert("decimal".to_string(), "DecimalType".to_string());
type_mappings.insert("positiveInt".to_string(), "PositiveIntType".to_string());
type_mappings.insert("unsignedInt".to_string(), "UnsignedIntType".to_string());
type_mappings.insert("uri".to_string(), "StringType".to_string());
type_mappings.insert("url".to_string(), "StringType".to_string());
type_mappings.insert("canonical".to_string(), "StringType".to_string());
type_mappings.insert("oid".to_string(), "StringType".to_string());
type_mappings.insert("id".to_string(), "StringType".to_string());
type_mappings.insert("markdown".to_string(), "StringType".to_string());
type_mappings.insert("base64Binary".to_string(), "Base64BinaryType".to_string());
type_mappings.insert("instant".to_string(), "InstantType".to_string());
type_mappings.insert("date".to_string(), "DateType".to_string());
type_mappings.insert("dateTime".to_string(), "DateTimeType".to_string());
type_mappings.insert("time".to_string(), "TimeType".to_string());
Self {
output_dir: "generated".to_string(),
module_name: "fhir_types".to_string(),
with_serde: true,
with_docs: true,
use_macro_calls: false, type_mappings,
crate_name: None,
}
}
}
impl Config for CodegenConfig {}