mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-05 18:25:57 +00:00
feat: export_schema
This commit is contained in:
parent
a87b39a2d1
commit
6d6b7020a0
1 changed files with 17 additions and 0 deletions
|
@ -183,3 +183,20 @@ fn merge<T: Copy>(target: &mut T, value: Option<T>) {
|
|||
*target = value;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use schemars::schema_for;
|
||||
|
||||
#[test]
|
||||
fn export_schema() {
|
||||
let theme_settings_content = schema_for!(ThemeSettingsContent);
|
||||
let output1 = serde_json::to_string_pretty(&theme_settings_content).unwrap();
|
||||
std::fs::write("schemas/theme_settings_content.json", output1);
|
||||
|
||||
let theme_settings = schema_for!(ThemeSettings);
|
||||
let output2 = serde_json::to_string_pretty(&theme_settings).unwrap();
|
||||
std::fs::write("schemas/theme_settings.json", output2);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue