Skip to content

Commit cf91520

Browse files
committed
Auto merge of #14683 - dacianpascu06:355adcad7, r=epage
Added unstable-schema generation for Cargo.toml ### What does this PR try to resolve? Added unstable-schema feature that generates JsonSchema for Cargo.toml See #12883 finished first step of [plan](#12883 (comment)) ### Information In cargo-util-schemas, run cargo test --feature unstable-schema . If there have been any changes to manifest.schema.json, rerun with env variable SNAPSHOTS=overwrite and it will update them. ### How should we test and review this PR? In cargo-util-schemas run cargo test --features unstable-schema and it will generate manifest.schema.json
2 parents 7571e92 + 21ce69e commit cf91520

File tree

7 files changed

+1679
-6
lines changed

7 files changed

+1679
-6
lines changed

Cargo.lock

Lines changed: 68 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ rusqlite = { version = "0.32.0", features = ["bundled"] }
8383
rustc-hash = "2.0.0"
8484
rustfix = { version = "0.8.2", path = "crates/rustfix" }
8585
same-file = "1.0.6"
86+
schemars = "0.8.21"
8687
security-framework = "2.11.1"
8788
semver = { version = "1.0.23", features = ["serde"] }
8889
serde = "1.0.204"

crates/cargo-util-schemas/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ repository.workspace = true
99
description = "Deserialization schemas for Cargo"
1010

1111
[dependencies]
12+
schemars = { workspace = true, features = ["preserve_order","semver"], optional = true }
1213
semver.workspace = true
1314
serde = { workspace = true, features = ["derive"] }
15+
serde_json = { workspace = true, optional = true }
1416
serde-untagged.workspace = true
1517
serde-value.workspace = true
1618
thiserror.workspace = true
@@ -23,3 +25,6 @@ workspace = true
2325

2426
[dev-dependencies]
2527
snapbox.workspace = true
28+
29+
[features]
30+
unstable-schema = ["dep:schemars", "dep:serde_json"]

0 commit comments

Comments
 (0)