chore(deps): bump schemars to 1.1

This commit is contained in:
LGUG2Z
2025-12-20 22:04:38 -08:00
parent 90271f1f99
commit 1cb8ed7f10
13 changed files with 8810 additions and 65848 deletions

30
Cargo.lock generated
View File

@@ -642,10 +642,10 @@ dependencies = [
[[package]]
name = "base16-egui-themes"
version = "0.1.0"
source = "git+https://github.com/LGUG2Z/base16-egui-themes?rev=5472b1ab825c48af1a1726e324cfa13b7c385135#5472b1ab825c48af1a1726e324cfa13b7c385135"
source = "git+https://github.com/LGUG2Z/base16-egui-themes?rev=adfed118ab1408f134fd7d8a549ccfe47b99d752#adfed118ab1408f134fd7d8a549ccfe47b99d752"
dependencies = [
"egui",
"schemars 0.8.22",
"schemars 1.1.0",
"serde",
"strum",
"strum_macros",
@@ -3147,7 +3147,7 @@ dependencies = [
"powershell_script",
"regex",
"reqwest",
"schemars 0.8.22",
"schemars 1.1.0",
"serde",
"serde_json_lenient",
"serde_with",
@@ -3197,7 +3197,7 @@ dependencies = [
"parking_lot",
"random_word",
"reqwest",
"schemars 0.8.22",
"schemars 1.1.0",
"serde",
"serde_json_lenient",
"starship-battery",
@@ -3252,7 +3252,7 @@ dependencies = [
"eframe",
"flavours",
"hex_color",
"schemars 0.8.22",
"schemars 1.1.0",
"serde",
"serde_variant",
"strum",
@@ -3275,7 +3275,7 @@ dependencies = [
"paste",
"powershell_script",
"reqwest",
"schemars 0.8.22",
"schemars 1.1.0",
"serde",
"serde_json_lenient",
"shadow-rs",
@@ -5607,18 +5607,6 @@ dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "schemars"
version = "0.8.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615"
dependencies = [
"dyn-clone",
"schemars_derive",
"serde",
"serde_json",
]
[[package]]
name = "schemars"
version = "0.9.0"
@@ -5639,15 +5627,16 @@ checksum = "9558e172d4e8533736ba97870c4b2cd63f84b382a3d6eb063da41b91cce17289"
dependencies = [
"dyn-clone",
"ref-cast",
"schemars_derive",
"serde",
"serde_json",
]
[[package]]
name = "schemars_derive"
version = "0.8.22"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d"
checksum = "301858a4023d78debd2353c7426dc486001bddc91ae31a76fb1f55132f7e2633"
dependencies = [
"proc-macro2",
"quote",
@@ -5825,7 +5814,6 @@ dependencies = [
"hex",
"indexmap 1.9.3",
"indexmap 2.12.1",
"schemars 0.8.22",
"schemars 0.9.0",
"schemars 1.1.0",
"serde_core",

View File

@@ -24,7 +24,7 @@ egui_extras = "0.33"
dirs = "6"
dunce = "1"
hotwatch = "0.5"
schemars = "0.8"
schemars = "1.1"
lazy_static = "1"
serde = { version = "1", features = ["derive"] }
serde_json = { package = "serde_json_lenient", version = "0.2" }

View File

@@ -46,7 +46,7 @@
"block-buffer 0.10.4 registry+https://github.com/rust-lang/crates.io-index",
"bytemuck 1.24.0 registry+https://github.com/rust-lang/crates.io-index",
"bytemuck_derive 1.10.2 registry+https://github.com/rust-lang/crates.io-index",
"cc 1.2.49 registry+https://github.com/rust-lang/crates.io-index",
"cc 1.2.50 registry+https://github.com/rust-lang/crates.io-index",
"cfg-if 0.1.10 registry+https://github.com/rust-lang/crates.io-index",
"cfg-if 1.0.4 registry+https://github.com/rust-lang/crates.io-index",
"chrono 0.4.42 registry+https://github.com/rust-lang/crates.io-index",
@@ -181,7 +181,7 @@
"native-tls 0.2.14 registry+https://github.com/rust-lang/crates.io-index",
"net2 0.2.39 registry+https://github.com/rust-lang/crates.io-index",
"nohash-hasher 0.2.0 registry+https://github.com/rust-lang/crates.io-index",
"ntapi 0.4.1 registry+https://github.com/rust-lang/crates.io-index",
"ntapi 0.4.2 registry+https://github.com/rust-lang/crates.io-index",
"num 0.4.3 registry+https://github.com/rust-lang/crates.io-index",
"num-bigint 0.4.6 registry+https://github.com/rust-lang/crates.io-index",
"num-complex 0.4.6 registry+https://github.com/rust-lang/crates.io-index",
@@ -231,6 +231,8 @@
"raw-window-handle 0.6.2 registry+https://github.com/rust-lang/crates.io-index",
"rayon 1.11.0 registry+https://github.com/rust-lang/crates.io-index",
"rayon-core 1.13.0 registry+https://github.com/rust-lang/crates.io-index",
"ref-cast 1.0.25 registry+https://github.com/rust-lang/crates.io-index",
"ref-cast-impl 1.0.25 registry+https://github.com/rust-lang/crates.io-index",
"regex 1.12.2 registry+https://github.com/rust-lang/crates.io-index",
"regex-automata 0.4.13 registry+https://github.com/rust-lang/crates.io-index",
"regex-syntax 0.8.8 registry+https://github.com/rust-lang/crates.io-index",
@@ -238,8 +240,8 @@
"roxmltree 0.20.0 registry+https://github.com/rust-lang/crates.io-index",
"rustc-demangle 0.1.26 registry+https://github.com/rust-lang/crates.io-index",
"rustc_version 0.4.1 registry+https://github.com/rust-lang/crates.io-index",
"rustls-pki-types 1.13.1 registry+https://github.com/rust-lang/crates.io-index",
"ryu 1.0.20 registry+https://github.com/rust-lang/crates.io-index",
"rustls-pki-types 1.13.2 registry+https://github.com/rust-lang/crates.io-index",
"ryu 1.0.21 registry+https://github.com/rust-lang/crates.io-index",
"scopeguard 1.2.0 registry+https://github.com/rust-lang/crates.io-index",
"semver 1.0.27 registry+https://github.com/rust-lang/crates.io-index",
"serde 1.0.228 registry+https://github.com/rust-lang/crates.io-index",
@@ -255,7 +257,7 @@
"serde_yaml 0.8.26 registry+https://github.com/rust-lang/crates.io-index",
"serde_yaml 0.9.34+deprecated registry+https://github.com/rust-lang/crates.io-index",
"sha2 0.10.9 registry+https://github.com/rust-lang/crates.io-index",
"shadow-rs 1.4.0 registry+https://github.com/rust-lang/crates.io-index",
"shadow-rs 1.5.0 registry+https://github.com/rust-lang/crates.io-index",
"shell-words 1.1.1 registry+https://github.com/rust-lang/crates.io-index",
"shellexpand 2.1.2 registry+https://github.com/rust-lang/crates.io-index",
"shlex 1.3.0 registry+https://github.com/rust-lang/crates.io-index",
@@ -269,7 +271,7 @@
"stacker 0.1.22 registry+https://github.com/rust-lang/crates.io-index",
"static_assertions 1.1.0 registry+https://github.com/rust-lang/crates.io-index",
"supports-color 3.0.2 registry+https://github.com/rust-lang/crates.io-index",
"supports-hyperlinks 3.1.0 registry+https://github.com/rust-lang/crates.io-index",
"supports-hyperlinks 3.2.0 registry+https://github.com/rust-lang/crates.io-index",
"supports-unicode 3.0.0 registry+https://github.com/rust-lang/crates.io-index",
"syn 1.0.109 registry+https://github.com/rust-lang/crates.io-index",
"syn 2.0.111 registry+https://github.com/rust-lang/crates.io-index",
@@ -421,7 +423,7 @@
[
"clipboard-win 5.4.1 registry+https://github.com/rust-lang/crates.io-index",
"error-code 3.3.2 registry+https://github.com/rust-lang/crates.io-index",
"ryu 1.0.20 registry+https://github.com/rust-lang/crates.io-index"
"ryu 1.0.21 registry+https://github.com/rust-lang/crates.io-index"
]
],
[
@@ -489,7 +491,7 @@
"calm_io 0.1.1 registry+https://github.com/rust-lang/crates.io-index",
"calmio_filters 0.1.0 registry+https://github.com/rust-lang/crates.io-index",
"catppuccin-egui 5.6.0 git+https://github.com/LGUG2Z/catppuccin-egui?rev=b2f95cbf441d1dd99f3c955ef10dcb84ce23c20a",
"cc 1.2.49 registry+https://github.com/rust-lang/crates.io-index",
"cc 1.2.50 registry+https://github.com/rust-lang/crates.io-index",
"cfg-if 0.1.10 registry+https://github.com/rust-lang/crates.io-index",
"cfg-if 1.0.4 registry+https://github.com/rust-lang/crates.io-index",
"cfg_aliases 0.2.1 registry+https://github.com/rust-lang/crates.io-index",
@@ -645,13 +647,13 @@
"nanoid 0.4.0 registry+https://github.com/rust-lang/crates.io-index",
"native-tls 0.2.14 registry+https://github.com/rust-lang/crates.io-index",
"net2 0.2.39 registry+https://github.com/rust-lang/crates.io-index",
"netdev 0.39.0 registry+https://github.com/rust-lang/crates.io-index",
"netdev 0.40.0 registry+https://github.com/rust-lang/crates.io-index",
"new_debug_unreachable 1.0.6 registry+https://github.com/rust-lang/crates.io-index",
"nohash-hasher 0.2.0 registry+https://github.com/rust-lang/crates.io-index",
"nom 7.1.3 registry+https://github.com/rust-lang/crates.io-index",
"nom 8.0.0 registry+https://github.com/rust-lang/crates.io-index",
"noop_proc_macro 0.3.0 registry+https://github.com/rust-lang/crates.io-index",
"ntapi 0.4.1 registry+https://github.com/rust-lang/crates.io-index",
"ntapi 0.4.2 registry+https://github.com/rust-lang/crates.io-index",
"nu-ansi-term 0.50.3 registry+https://github.com/rust-lang/crates.io-index",
"num 0.4.3 registry+https://github.com/rust-lang/crates.io-index",
"num-bigint 0.4.6 registry+https://github.com/rust-lang/crates.io-index",
@@ -713,6 +715,8 @@
"raw-window-handle 0.6.2 registry+https://github.com/rust-lang/crates.io-index",
"rayon 1.11.0 registry+https://github.com/rust-lang/crates.io-index",
"rayon-core 1.13.0 registry+https://github.com/rust-lang/crates.io-index",
"ref-cast 1.0.25 registry+https://github.com/rust-lang/crates.io-index",
"ref-cast-impl 1.0.25 registry+https://github.com/rust-lang/crates.io-index",
"regex 1.12.2 registry+https://github.com/rust-lang/crates.io-index",
"regex-automata 0.4.13 registry+https://github.com/rust-lang/crates.io-index",
"regex-syntax 0.8.8 registry+https://github.com/rust-lang/crates.io-index",
@@ -721,11 +725,11 @@
"roxmltree 0.20.0 registry+https://github.com/rust-lang/crates.io-index",
"rustc-demangle 0.1.26 registry+https://github.com/rust-lang/crates.io-index",
"rustc_version 0.4.1 registry+https://github.com/rust-lang/crates.io-index",
"rustls-pki-types 1.13.1 registry+https://github.com/rust-lang/crates.io-index",
"rustls-pki-types 1.13.2 registry+https://github.com/rust-lang/crates.io-index",
"same-file 1.0.6 registry+https://github.com/rust-lang/crates.io-index",
"schannel 0.1.28 registry+https://github.com/rust-lang/crates.io-index",
"schemars 0.8.22 registry+https://github.com/rust-lang/crates.io-index",
"schemars_derive 0.8.22 registry+https://github.com/rust-lang/crates.io-index",
"schemars 1.1.0 registry+https://github.com/rust-lang/crates.io-index",
"schemars_derive 1.1.0 registry+https://github.com/rust-lang/crates.io-index",
"scoped_threadpool 0.1.9 registry+https://github.com/rust-lang/crates.io-index",
"scopeguard 1.2.0 registry+https://github.com/rust-lang/crates.io-index",
"semver 1.0.27 registry+https://github.com/rust-lang/crates.io-index",
@@ -742,7 +746,7 @@
"serde_yaml 0.8.26 registry+https://github.com/rust-lang/crates.io-index",
"serde_yaml 0.9.34+deprecated registry+https://github.com/rust-lang/crates.io-index",
"sha2 0.10.9 registry+https://github.com/rust-lang/crates.io-index",
"shadow-rs 1.4.0 registry+https://github.com/rust-lang/crates.io-index",
"shadow-rs 1.5.0 registry+https://github.com/rust-lang/crates.io-index",
"sharded-slab 0.1.7 registry+https://github.com/rust-lang/crates.io-index",
"shell-words 1.1.1 registry+https://github.com/rust-lang/crates.io-index",
"shellexpand 2.1.2 registry+https://github.com/rust-lang/crates.io-index",
@@ -785,10 +789,10 @@
"tower-http 0.6.8 registry+https://github.com/rust-lang/crates.io-index",
"tower-layer 0.3.3 registry+https://github.com/rust-lang/crates.io-index",
"tower-service 0.3.3 registry+https://github.com/rust-lang/crates.io-index",
"tracing 0.1.43 registry+https://github.com/rust-lang/crates.io-index",
"tracing 0.1.44 registry+https://github.com/rust-lang/crates.io-index",
"tracing-appender 0.2.4 registry+https://github.com/rust-lang/crates.io-index",
"tracing-attributes 0.1.31 registry+https://github.com/rust-lang/crates.io-index",
"tracing-core 0.1.35 registry+https://github.com/rust-lang/crates.io-index",
"tracing-core 0.1.36 registry+https://github.com/rust-lang/crates.io-index",
"tracing-error 0.2.1 registry+https://github.com/rust-lang/crates.io-index",
"tracing-log 0.2.0 registry+https://github.com/rust-lang/crates.io-index",
"tracing-subscriber 0.3.22 registry+https://github.com/rust-lang/crates.io-index",

View File

@@ -114,15 +114,8 @@ fn main() -> color_eyre::Result<()> {
#[cfg(feature = "schemars")]
if opts.schema {
let settings = schemars::r#gen::SchemaSettings::default().with(|s| {
s.option_nullable = false;
s.option_add_null_type = false;
s.inline_subschemas = true;
});
let generator = settings.into_generator();
let socket_message = generator.into_root_schema_for::<KomobarConfig>();
let schema = serde_json::to_string_pretty(&socket_message)?;
let bar_config = schemars::schema_for!(KomobarConfig);
let schema = serde_json::to_string_pretty(&bar_config)?;
println!("{schema}");
std::process::exit(0);

View File

@@ -4,7 +4,7 @@ version = "0.1.40"
edition = "2024"
[dependencies]
base16-egui-themes = { git = "https://github.com/LGUG2Z/base16-egui-themes", rev = "5472b1ab825c48af1a1726e324cfa13b7c385135" }
base16-egui-themes = { git = "https://github.com/LGUG2Z/base16-egui-themes", rev = "adfed118ab1408f134fd7d8a549ccfe47b99d752" }
#catppuccin-egui = { version = "5", default-features = false, features = ["egui32"] }
catppuccin-egui = { git = "https://github.com/LGUG2Z/catppuccin-egui", rev = "b2f95cbf441d1dd99f3c955ef10dcb84ce23c20a", default-features = false, features = ["egui33"] }
eframe = { workspace = true }

View File

@@ -1,12 +1,8 @@
use hex_color::HexColor;
#[cfg(feature = "schemars")]
use schemars::Schema;
#[cfg(feature = "schemars")]
use schemars::SchemaGenerator;
#[cfg(feature = "schemars")]
use schemars::schema::InstanceType;
#[cfg(feature = "schemars")]
use schemars::schema::Schema;
#[cfg(feature = "schemars")]
use schemars::schema::SchemaObject;
use crate::Color32;
use serde::Deserialize;
@@ -61,17 +57,15 @@ pub struct Hex(pub HexColor);
#[cfg(feature = "schemars")]
impl schemars::JsonSchema for Hex {
fn schema_name() -> String {
String::from("Hex")
fn schema_name() -> std::borrow::Cow<'static, str> {
std::borrow::Cow::Borrowed("Hex")
}
fn json_schema(_: &mut SchemaGenerator) -> Schema {
SchemaObject {
instance_type: Some(InstanceType::String.into()),
format: Some("color-hex".to_string()),
..Default::default()
}
.into()
schemars::json_schema!({
"type": "string",
"format": "color-hex"
})
}
}

View File

@@ -51,7 +51,7 @@ windows-implement = { workspace = true }
windows-interface = { workspace = true }
winput = "0.2"
winreg = "0.55"
serde_with = { version = "3.12", features = ["schemars_0_8"] }
serde_with = { version = "3.12", features = ["schemars_1"] }
[build-dependencies]
shadow-rs = { workspace = true }

View File

@@ -121,12 +121,12 @@ impl<'de> serde_with::DeserializeAs<'de, PathBuf> for ResolvedPathBuf {
}
#[cfg(feature = "schemars")]
impl serde_with::schemars_0_8::JsonSchemaAs<PathBuf> for ResolvedPathBuf {
fn schema_name() -> String {
"PathBuf".to_owned()
impl serde_with::schemars_1::JsonSchemaAs<PathBuf> for ResolvedPathBuf {
fn schema_name() -> std::borrow::Cow<'static, str> {
std::borrow::Cow::Borrowed("PathBuf")
}
fn json_schema(generator: &mut schemars::SchemaGenerator) -> schemars::schema::Schema {
fn json_schema(generator: &mut schemars::SchemaGenerator) -> schemars::Schema {
<PathBuf as schemars::JsonSchema>::json_schema(generator)
}
}

View File

@@ -2224,14 +2224,7 @@ if (!(Get-Process komorebi-bar -ErrorAction SilentlyContinue))
SocketMessage::StaticConfigSchema => {
#[cfg(feature = "schemars")]
{
let settings = schemars::r#gen::SchemaSettings::default().with(|s| {
s.option_nullable = false;
s.option_add_null_type = false;
s.inline_subschemas = true;
});
let generator = settings.into_generator();
let socket_message = generator.into_root_schema_for::<StaticConfig>();
let socket_message = schemars::schema_for!(SocketMessage);
let schema = serde_json::to_string_pretty(&socket_message)?;
reply.write_all(schema.as_bytes())?;

View File

@@ -3343,15 +3343,8 @@ if (Get-Command Get-CimInstance -ErrorAction SilentlyContinue) {
SubCommand::StaticConfigSchema => {
#[cfg(feature = "schemars")]
{
let settings = schemars::r#gen::SchemaSettings::default().with(|s| {
s.option_nullable = false;
s.option_add_null_type = false;
s.inline_subschemas = true;
});
let generator = settings.into_generator();
let socket_message = generator.into_root_schema_for::<StaticConfig>();
let schema = serde_json::to_string_pretty(&socket_message)?;
let static_config = schemars::schema_for!(StaticConfig);
let schema = serde_json::to_string_pretty(&static_config)?;
println!("{schema}");
}
}

View File

@@ -1,11 +1,11 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ApplicationSpecificConfiguration",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/AscApplicationRulesOrSchema"
"$ref": "#/$defs/AscApplicationRulesOrSchema"
},
"definitions": {
"$defs": {
"ApplicationIdentifier": {
"type": "string",
"enum": [
@@ -26,7 +26,7 @@
"null"
],
"items": {
"$ref": "#/definitions/MatchingRule"
"$ref": "#/$defs/MatchingRule"
}
},
"ignore": {
@@ -36,7 +36,7 @@
"null"
],
"items": {
"$ref": "#/definitions/MatchingRule"
"$ref": "#/$defs/MatchingRule"
}
},
"layered": {
@@ -46,7 +46,7 @@
"null"
],
"items": {
"$ref": "#/definitions/MatchingRule"
"$ref": "#/$defs/MatchingRule"
}
},
"manage": {
@@ -56,7 +56,7 @@
"null"
],
"items": {
"$ref": "#/definitions/MatchingRule"
"$ref": "#/$defs/MatchingRule"
}
},
"object_name_change": {
@@ -66,7 +66,7 @@
"null"
],
"items": {
"$ref": "#/definitions/MatchingRule"
"$ref": "#/$defs/MatchingRule"
}
},
"slow_application": {
@@ -76,7 +76,7 @@
"null"
],
"items": {
"$ref": "#/definitions/MatchingRule"
"$ref": "#/$defs/MatchingRule"
}
},
"transparency_ignore": {
@@ -86,7 +86,7 @@
"null"
],
"items": {
"$ref": "#/definitions/MatchingRule"
"$ref": "#/$defs/MatchingRule"
}
},
"tray_and_multi_window": {
@@ -96,7 +96,7 @@
"null"
],
"items": {
"$ref": "#/definitions/MatchingRule"
"$ref": "#/$defs/MatchingRule"
}
}
}
@@ -104,7 +104,7 @@
"AscApplicationRulesOrSchema": {
"anyOf": [
{
"$ref": "#/definitions/AscApplicationRules"
"$ref": "#/$defs/AscApplicationRules"
},
{
"type": "string"
@@ -113,38 +113,38 @@
},
"IdWithIdentifier": {
"type": "object",
"required": [
"id",
"kind"
],
"properties": {
"id": {
"type": "string"
},
"kind": {
"$ref": "#/definitions/ApplicationIdentifier"
"$ref": "#/$defs/ApplicationIdentifier"
},
"matching_strategy": {
"anyOf": [
{
"$ref": "#/definitions/MatchingStrategy"
"$ref": "#/$defs/MatchingStrategy"
},
{
"type": "null"
}
]
}
}
},
"required": [
"kind",
"id"
]
},
"MatchingRule": {
"anyOf": [
{
"$ref": "#/definitions/IdWithIdentifier"
"$ref": "#/$defs/IdWithIdentifier"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/IdWithIdentifier"
"$ref": "#/$defs/IdWithIdentifier"
}
}
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff