Skip to content

Commit

Permalink
Auto merge of #14683 - dacianpascu06:355adcad7, r=epage
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Oct 24, 2024
2 parents 7571e92 + 21ce69e commit cf91520
Show file tree
Hide file tree
Showing 7 changed files with 1,679 additions and 6 deletions.
74 changes: 68 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ rusqlite = { version = "0.32.0", features = ["bundled"] }
rustc-hash = "2.0.0"
rustfix = { version = "0.8.2", path = "crates/rustfix" }
same-file = "1.0.6"
schemars = "0.8.21"
security-framework = "2.11.1"
semver = { version = "1.0.23", features = ["serde"] }
serde = "1.0.204"
Expand Down
5 changes: 5 additions & 0 deletions crates/cargo-util-schemas/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ repository.workspace = true
description = "Deserialization schemas for Cargo"

[dependencies]
schemars = { workspace = true, features = ["preserve_order","semver"], optional = true }
semver.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true, optional = true }
serde-untagged.workspace = true
serde-value.workspace = true
thiserror.workspace = true
Expand All @@ -23,3 +25,6 @@ workspace = true

[dev-dependencies]
snapbox.workspace = true

[features]
unstable-schema = ["dep:schemars", "dep:serde_json"]
Loading

0 comments on commit cf91520

Please sign in to comment.