pub fn json_dumps<T: Serialize>( data: &T, pretty: bool, ) -> Result<String, Box<dyn Error>>
Serialize data to JSON string with pretty formatting.