Add project settings schema to schema_generator CLI (#44321)

Release Notes:

- Added project settings schema to the schema_generator CLI. This allows
for exporting the project settings schema as JSON for use in other
tools.
This commit is contained in:
Dan Greco
2025-12-16 10:48:14 -05:00
committed by GitHub
parent 935a7cc310
commit 005a85e57b
3 changed files with 8 additions and 0 deletions

1
Cargo.lock generated
View File

@@ -14249,6 +14249,7 @@ dependencies = [
"schemars",
"serde",
"serde_json",
"settings",
"theme",
]

View File

@@ -15,4 +15,5 @@ env_logger.workspace = true
schemars = { workspace = true, features = ["indexmap2"] }
serde.workspace = true
serde_json.workspace = true
settings.workspace = true
theme.workspace = true

View File

@@ -1,6 +1,7 @@
use anyhow::Result;
use clap::{Parser, ValueEnum};
use schemars::schema_for;
use settings::ProjectSettingsContent;
use theme::{IconThemeFamilyContent, ThemeFamilyContent};
#[derive(Parser, Debug)]
@@ -14,6 +15,7 @@ pub struct Args {
pub enum SchemaType {
Theme,
IconTheme,
Project,
}
fn main() -> Result<()> {
@@ -30,6 +32,10 @@ fn main() -> Result<()> {
let schema = schema_for!(IconThemeFamilyContent);
println!("{}", serde_json::to_string_pretty(&schema)?);
}
SchemaType::Project => {
let schema = schema_for!(ProjectSettingsContent);
println!("{}", serde_json::to_string_pretty(&schema)?);
}
}
Ok(())