Skip to content

[deps]: Update Rust crate schemars to >=0.8.9, <0.10 #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ reqwest = { version = ">=0.12.5, <0.13", features = [
"multipart",
"http2",
], default-features = false }
schemars = { version = ">=0.8.9, <0.9", features = ["uuid1", "chrono"] }
schemars = { version = ">=1.0.0, <2.0", features = ["uuid1", "chrono04"] }
serde = { version = ">=1.0, <2.0", features = ["derive"] }
serde_json = ">=1.0.96, <2.0"
serde_qs = ">=0.12.0, <0.16"
Expand Down
10 changes: 5 additions & 5 deletions crates/bitwarden-crypto/src/enc_string/asymmetric.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{fmt::Display, str::FromStr};
use std::{borrow::Cow, fmt::Display, str::FromStr};

use base64::{engine::general_purpose::STANDARD, Engine};
pub use internal::UnsignedSharedKey;
Expand Down Expand Up @@ -227,11 +227,11 @@ impl UnsignedSharedKey {
/// But during the transition phase we will expose endpoints using the UnsignedSharedKey
/// type.
impl schemars::JsonSchema for UnsignedSharedKey {
fn schema_name() -> String {
"UnsignedSharedKey".to_string()
fn schema_name() -> Cow<'static, str> {
"UnsignedSharedKey".into()
}

fn json_schema(generator: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
fn json_schema(generator: &mut schemars::generate::SchemaGenerator) -> schemars::Schema {
generator.subschema_for::<String>()
}
}
Expand Down Expand Up @@ -355,7 +355,7 @@ XKZBokBGnjFnTnKcs7nv/O8=

assert_eq!(
serde_json::to_string(&schema).unwrap(),
r#"{"$schema":"http://json-schema.org/draft-07/schema#","title":"UnsignedSharedKey","type":"string"}"#
r#"{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"UnsignedSharedKey","type":"string"}"#
);
}
}
10 changes: 5 additions & 5 deletions crates/bitwarden-crypto/src/enc_string/symmetric.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::str::FromStr;
use std::{borrow::Cow, str::FromStr};

use base64::{engine::general_purpose::STANDARD, Engine};
use coset::CborSerializable;
Expand Down Expand Up @@ -336,11 +336,11 @@ impl KeyDecryptable<SymmetricCryptoKey, String> for EncString {
/// Usually we wouldn't want to expose EncStrings in the API or the schemas.
/// But during the transition phase we will expose endpoints using the EncString type.
impl schemars::JsonSchema for EncString {
fn schema_name() -> String {
"EncString".to_string()
fn schema_name() -> Cow<'static, str> {
"EncString".into()
}

fn json_schema(generator: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
fn json_schema(generator: &mut schemars::generate::SchemaGenerator) -> schemars::Schema {
generator.subschema_for::<String>()
}
}
Expand Down Expand Up @@ -508,7 +508,7 @@ mod tests {

assert_eq!(
serde_json::to_string(&schema).unwrap(),
r#"{"$schema":"http://json-schema.org/draft-07/schema#","title":"EncString","type":"string"}"#
r#"{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"EncString","type":"string"}"#
);
}
}
8 changes: 4 additions & 4 deletions crates/bitwarden-crypto/src/keys/signed_public_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! identity, which is provided by a signature keypair. This is done by signing the public key, and
//! requiring consumers to verify the public key before consumption by using unwrap_and_verify.

use std::str::FromStr;
use std::{borrow::Cow, str::FromStr};

use base64::{engine::general_purpose::STANDARD, Engine};
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -150,11 +150,11 @@
}

impl schemars::JsonSchema for SignedPublicKey {
fn schema_name() -> String {
"SignedPublicKey".to_string()
fn schema_name() -> Cow<'static, str> {
"SignedPublicKey".into()

Check warning on line 154 in crates/bitwarden-crypto/src/keys/signed_public_key.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-crypto/src/keys/signed_public_key.rs#L153-L154

Added lines #L153 - L154 were not covered by tests
}

fn json_schema(generator: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
fn json_schema(generator: &mut schemars::generate::SchemaGenerator) -> schemars::Schema {

Check warning on line 157 in crates/bitwarden-crypto/src/keys/signed_public_key.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-crypto/src/keys/signed_public_key.rs#L157

Added line #L157 was not covered by tests
generator.subschema_for::<String>()
}
}
Expand Down
Loading