From 441249a53b5dd3e560ebcb64645c2cfe31a943f7 Mon Sep 17 00:00:00 2001 From: Graham Esau Date: Thu, 29 Aug 2024 17:29:05 +0100 Subject: [PATCH] 1.0.0-alpha.14 --- CHANGELOG.md | 6 ++++++ Cargo.lock | 4 ++-- README.md | 2 +- docs/4-features.md | 2 +- docs/_includes/attributes.md | 2 +- schemars/Cargo.toml | 4 ++-- schemars_derive/Cargo.toml | 2 +- 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a30ba026..98754dc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [1.0.0-alpha.14] - 2024-08-29 + +### Added + +- Read `#[garde(...)]` attributes as an alternative to `#[validate(...)]` (https://github.com/GREsau/schemars/issues/233 / https://github.com/GREsau/schemars/pull/331). See [the documentation](https://graham.cool/schemars/deriving/attributes/#supported-validatorgarde-attributes) for a full list of supported attributes. + ## [1.0.0-alpha.13] - 2024-08-27 ### Fixed diff --git a/Cargo.lock b/Cargo.lock index a549c0a7..f39bca27 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -309,7 +309,7 @@ checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "schemars" -version = "1.0.0-alpha.13" +version = "1.0.0-alpha.14" dependencies = [ "arrayvec", "bigdecimal", @@ -335,7 +335,7 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "1.0.0-alpha.13" +version = "1.0.0-alpha.14" dependencies = [ "pretty_assertions", "proc-macro2", diff --git a/README.md b/README.md index 1bcc121f..4e4b1643 100644 --- a/README.md +++ b/README.md @@ -281,5 +281,5 @@ For example, to implement `JsonSchema` on types from `chrono`, enable it as a fe ```toml [dependencies] -schemars = { version = "1.0.0-alpha.13", features = ["chrono04"] } +schemars = { version = "1.0.0-alpha.14", features = ["chrono04"] } ``` diff --git a/docs/4-features.md b/docs/4-features.md index 271058c0..2ae7dae2 100644 --- a/docs/4-features.md +++ b/docs/4-features.md @@ -31,5 +31,5 @@ For example, to implement `JsonSchema` on types from `chrono`, enable it as a fe ```toml [dependencies] -schemars = { version = "1.0.0-alpha.13", features = ["chrono04"] } +schemars = { version = "1.0.0-alpha.14", features = ["chrono04"] } ``` diff --git a/docs/_includes/attributes.md b/docs/_includes/attributes.md index 2ae66ab2..37f6833b 100644 --- a/docs/_includes/attributes.md +++ b/docs/_includes/attributes.md @@ -234,7 +234,7 @@ Validator docs: [range](https://github.com/Keats/validator#range) Sets the `pattern` property for string schemas. The `static_regex` will typically refer to a [`Regex`](https://docs.rs/regex/*/regex/struct.Regex.html) instance, but Schemars allows it to be any value with a `to_string()` method. -`regex(pattern = ...)` is a Schemars extension, and not currently supported by the Validator crate. When using this form (or the Garde-style `pattern` attribute), you may want to use a `r"raw string literal"` so that `\\` characters in the regex pattern are not interpreted as escape sequences in the string. Using the `path` form is not allowed in a `#[schemars(...)]` attribute. +`regex(pattern = ...)` is a Schemars extension, and not currently supported by the Validator crate. When using this form (or the Garde-style `pattern` attribute), you may want to use a `r"raw string literal"` so that `\\` characters in the regex pattern are not interpreted as escape sequences in the string. Using the `path = ...` form is not allowed in a `#[schemars(...)]` attribute. Validator docs: [regex](https://github.com/Keats/validator#regex) diff --git a/schemars/Cargo.toml b/schemars/Cargo.toml index 42c7a1e2..42457472 100644 --- a/schemars/Cargo.toml +++ b/schemars/Cargo.toml @@ -3,7 +3,7 @@ name = "schemars" description = "Generate JSON Schemas from Rust code" homepage = "https://graham.cool/schemars/" repository = "https://github.com/GREsau/schemars" -version = "1.0.0-alpha.13" +version = "1.0.0-alpha.14" authors = ["Graham Esau "] edition = "2021" license = "MIT" @@ -13,7 +13,7 @@ categories = ["encoding", "no-std"] rust-version = "1.65" [dependencies] -schemars_derive = { version = "=1.0.0-alpha.13", optional = true, path = "../schemars_derive" } +schemars_derive = { version = "=1.0.0-alpha.14", optional = true, path = "../schemars_derive" } serde = { version = "1.0", default-features = false, features = ["alloc"]} serde_json = { version = "1.0.127", default-features = false, features = ["alloc"] } dyn-clone = "1.0" diff --git a/schemars_derive/Cargo.toml b/schemars_derive/Cargo.toml index 2c0e2173..1ab7ca98 100644 --- a/schemars_derive/Cargo.toml +++ b/schemars_derive/Cargo.toml @@ -3,7 +3,7 @@ name = "schemars_derive" description = "Macros for #[derive(JsonSchema)], for use with schemars" homepage = "https://graham.cool/schemars/" repository = "https://github.com/GREsau/schemars" -version = "1.0.0-alpha.13" +version = "1.0.0-alpha.14" authors = ["Graham Esau "] edition = "2021" license = "MIT"