diff --git a/Cargo.lock b/Cargo.lock index e40d05d..388c3e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -122,12 +122,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - [[package]] name = "automod" version = "1.0.15" @@ -376,12 +370,6 @@ dependencies = [ "regex-syntax", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.14.5" @@ -442,17 +430,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - [[package]] name = "indexmap" version = "2.2.6" @@ -460,7 +437,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown", ] [[package]] @@ -634,6 +611,26 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "regex" version = "1.10.4" @@ -705,12 +702,12 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.21" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" dependencies = [ "dyn-clone", - "indexmap 1.9.3", + "ref-cast", "schemars_derive", "serde", "serde_json", @@ -718,9 +715,9 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.21" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +checksum = "5016d94c77c6d32f0b8e08b781f7dc8a90c2007d4e77472cc2807bc10a8438fe" dependencies = [ "proc-macro2", "quote", @@ -761,11 +758,13 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ + "indexmap", "itoa", + "memchr", "ryu", "serde", ] @@ -898,7 +897,7 @@ version = "0.22.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" dependencies = [ - "indexmap 2.2.6", + "indexmap", "serde", "serde_spanned", "toml_datetime", diff --git a/crates/trycmd/Cargo.toml b/crates/trycmd/Cargo.toml index 617904e..bf4fbbe 100644 --- a/crates/trycmd/Cargo.toml +++ b/crates/trycmd/Cargo.toml @@ -60,7 +60,7 @@ humantime-serde = "1" toml_edit = { version = "0.22.13", features = ["serde"] } escargot = { version = "0.5.13", optional = true } -schemars = { version = "0.8.21", features = ["preserve_order"], optional = true } +schemars = { version = "0.9.0", features = ["preserve_order"], optional = true } serde_json = { version = "1.0", optional = true } [lints] diff --git a/crates/trycmd/schema.json b/crates/trycmd/schema.json index c88afc3..8e72a02 100644 --- a/crates/trycmd/schema.json +++ b/crates/trycmd/schema.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "OneShot", "description": "Top-level data in `cmd.toml` files", "type": "object", @@ -7,7 +7,7 @@ "bin": { "anyOf": [ { - "$ref": "#/definitions/Bin" + "$ref": "#/$defs/Bin" }, { "type": "null" @@ -15,54 +15,46 @@ ] }, "args": { - "default": [], - "allOf": [ - { - "$ref": "#/definitions/Args" - } - ] + "$ref": "#/$defs/Args", + "default": [] }, "env": { + "$ref": "#/$defs/Env", "default": { - "add": {}, "inherit": null, + "add": {}, "remove": [] - }, - "allOf": [ - { - "$ref": "#/definitions/Env" - } - ] + } }, "stdin": { - "default": null, "type": [ "string", "null" - ] + ], + "default": null }, "stdout": { - "default": null, "type": [ "string", "null" - ] + ], + "default": null }, "stderr": { - "default": null, "type": [ "string", "null" - ] + ], + "default": null }, "stderr-to-stdout": { - "default": false, - "type": "boolean" + "type": "boolean", + "default": false }, "status": { "anyOf": [ { - "$ref": "#/definitions/CommandStatus" + "$ref": "#/$defs/CommandStatus" }, { "type": "null" @@ -70,34 +62,30 @@ ] }, "binary": { - "default": false, - "type": "boolean" + "type": "boolean", + "default": false }, "timeout": { - "default": null, "anyOf": [ { - "$ref": "#/definitions/Duration" + "$ref": "#/$defs/Duration" }, { "type": "null" } - ] + ], + "default": null }, "fs": { + "$ref": "#/$defs/Filesystem", "default": { - "base": null, "cwd": null, + "base": null, "sandbox": null - }, - "allOf": [ - { - "$ref": "#/definitions/Filesystem" - } - ] + } } }, - "definitions": { + "$defs": { "Bin": { "description": "Target under test", "oneOf": [ @@ -109,26 +97,26 @@ }, { "type": "object", - "required": [ - "path" - ], "properties": { "path": { "type": "string" } }, + "required": [ + "path" + ], "additionalProperties": false }, { "type": "object", - "required": [ - "name" - ], "properties": { "name": { "type": "string" } }, + "required": [ + "name" + ], "additionalProperties": false } ] @@ -136,7 +124,7 @@ "Args": { "anyOf": [ { - "$ref": "#/definitions/JoinedArgs" + "$ref": "#/$defs/JoinedArgs" }, { "type": "array", @@ -148,9 +136,6 @@ }, "JoinedArgs": { "type": "object", - "required": [ - "inner" - ], "properties": { "inner": { "type": "array", @@ -158,32 +143,35 @@ "type": "string" } } - } + }, + "required": [ + "inner" + ] }, "Env": { "description": "Describe command's environment", "type": "object", "properties": { "inherit": { - "default": null, "type": [ "boolean", "null" - ] + ], + "default": null }, "add": { - "default": {}, "type": "object", "additionalProperties": { "type": "string" - } + }, + "default": {} }, "remove": { - "default": [], "type": "array", "items": { "type": "string" - } + }, + "default": [] } } }, @@ -201,37 +189,37 @@ }, { "type": "object", - "required": [ - "code" - ], "properties": { "code": { "type": "integer", "format": "int32" } }, + "required": [ + "code" + ], "additionalProperties": false } ] }, "Duration": { "type": "object", - "required": [ - "nanos", - "secs" - ], "properties": { "secs": { "type": "integer", "format": "uint64", - "minimum": 0.0 + "minimum": 0 }, "nanos": { "type": "integer", "format": "uint32", - "minimum": 0.0 + "minimum": 0 } - } + }, + "required": [ + "secs", + "nanos" + ] }, "Filesystem": { "description": "Describe the command's filesystem context",