Update dependencies (#368)
This commit is contained in:
parent
f8c1fe21b7
commit
efb74969e2
5 changed files with 453 additions and 397 deletions
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
|
@ -24,6 +24,14 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Downgrade packages for MSRV
|
||||||
|
if: matrix.rust == '1.70.0'
|
||||||
|
run: |
|
||||||
|
cargo add --dev jsonschema@0.20
|
||||||
|
cargo add --dev garde --git https://github.com/jprochazk/garde.git --rev be00ddddf8de14530ee890ccfdbaf0b13fb32852
|
||||||
|
cargo add --dev validator@0.18.1
|
||||||
|
cargo update url --precise 2.5.2
|
||||||
|
working-directory: ./schemars
|
||||||
- uses: dtolnay/rust-toolchain@master
|
- uses: dtolnay/rust-toolchain@master
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.rust }}
|
toolchain: ${{ matrix.rust }}
|
||||||
|
|
819
Cargo.lock
generated
819
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -37,12 +37,11 @@ uuid1 = { version = "1.0", default-features = false, optional = true, package =
|
||||||
pretty_assertions = "1.2.1"
|
pretty_assertions = "1.2.1"
|
||||||
trybuild = "1.0"
|
trybuild = "1.0"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
jsonschema = { version = "0.20", default-features = false }
|
jsonschema = { version = "0.28", default-features = false }
|
||||||
snapbox = { version = "0.6.17", features = ["json"] }
|
snapbox = { version = "0.6.17", features = ["json"] }
|
||||||
serde_repr = "0.1.19"
|
serde_repr = "0.1.19"
|
||||||
# Use github source until published garde version supports `length(equal = ...)` attr
|
garde = { version = "0.22", features = ["derive", "email", "regex", "url"] }
|
||||||
garde = { git = "https://github.com/jprochazk/garde.git", rev = "be00ddddf8de14530ee890ccfdbaf0b13fb32852", features = ["derive", "email", "regex", "url"] }
|
validator = { version = "0.20", features = ["derive"] }
|
||||||
validator = { version = "0.18.1", features = ["derive"] }
|
|
||||||
regex = { version = "1.10.6", default-features = false }
|
regex = { version = "1.10.6", default-features = false }
|
||||||
|
|
||||||
arrayvec07 = { version = "0.7", default-features = false, features = ["serde"], package = "arrayvec"}
|
arrayvec07 = { version = "0.7", default-features = false, features = ["serde"], package = "arrayvec"}
|
||||||
|
|
|
@ -60,8 +60,12 @@ fn custom_struct() {
|
||||||
fn custom_struct_openapi3() {
|
fn custom_struct_openapi3() {
|
||||||
let value = struct_value();
|
let value = struct_value();
|
||||||
|
|
||||||
test!(value: value.clone(), SchemaSettings::openapi3())
|
test!(value: value.clone(), SchemaSettings::openapi3()).assert_snapshot();
|
||||||
.assert_snapshot()
|
|
||||||
|
// schemars uses a nonstandard meta-schema for openapi 3.0 which the jsonschema crate doesn't
|
||||||
|
// accept, so we swap it out for the standard draft-04 meta-schema.
|
||||||
|
let draft04 = "http://json-schema.org/draft-04/schema".to_owned();
|
||||||
|
test!(value: value.clone(), SchemaSettings::openapi3().with(|o| o.meta_schema = Some(draft04)))
|
||||||
.assert_allows_ser_roundtrip([value, MyStruct::default()]);
|
.assert_allows_ser_roundtrip([value, MyStruct::default()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ use schemars::{
|
||||||
};
|
};
|
||||||
use serde::{de::DeserializeOwned, Serialize};
|
use serde::{de::DeserializeOwned, Serialize};
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
use snapbox::IntoJson;
|
use snapbox::{data::DataFormat, IntoJson};
|
||||||
use std::{
|
use std::{
|
||||||
any::type_name, borrow::Borrow, cell::OnceCell, f64, marker::PhantomData, path::Path,
|
any::type_name, borrow::Borrow, cell::OnceCell, f64, marker::PhantomData, path::Path,
|
||||||
sync::OnceLock,
|
sync::OnceLock,
|
||||||
|
@ -74,18 +74,18 @@ impl<T: JsonSchema> TestHelper<T> {
|
||||||
if self.de_schema == self.ser_schema {
|
if self.de_schema == self.ser_schema {
|
||||||
snapbox::assert_data_eq!(
|
snapbox::assert_data_eq!(
|
||||||
(&self.de_schema).into_json(),
|
(&self.de_schema).into_json(),
|
||||||
snapbox::Data::read_from(Path::new(&common_path), None).raw()
|
snapbox::Data::read_from(Path::new(&common_path), Some(DataFormat::Json)).raw()
|
||||||
);
|
);
|
||||||
_ = std::fs::remove_file(de_path);
|
_ = std::fs::remove_file(de_path);
|
||||||
_ = std::fs::remove_file(ser_path);
|
_ = std::fs::remove_file(ser_path);
|
||||||
} else {
|
} else {
|
||||||
snapbox::assert_data_eq!(
|
snapbox::assert_data_eq!(
|
||||||
(&self.de_schema).into_json(),
|
(&self.de_schema).into_json(),
|
||||||
snapbox::Data::read_from(Path::new(&de_path), None).raw()
|
snapbox::Data::read_from(Path::new(&de_path), Some(DataFormat::Json)).raw()
|
||||||
);
|
);
|
||||||
snapbox::assert_data_eq!(
|
snapbox::assert_data_eq!(
|
||||||
(&self.ser_schema).into_json(),
|
(&self.ser_schema).into_json(),
|
||||||
snapbox::Data::read_from(Path::new(&ser_path), None).raw()
|
snapbox::Data::read_from(Path::new(&ser_path), Some(DataFormat::Json)).raw()
|
||||||
);
|
);
|
||||||
_ = std::fs::remove_file(common_path);
|
_ = std::fs::remove_file(common_path);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue