Skip to content

Commit 1a956d4

Browse files
[deps]: Update Rust crate schemars to >=0.8.9, <0.10 (#324)
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [schemars](https://graham.cool/schemars/) ([source](https://redirect.github.com/GREsau/schemars)) | workspace.dependencies | minor | `>=0.8.9, <0.9` -> `>=0.8.9, <0.10` | --- ### Release Notes <details> <summary>GREsau/schemars (schemars)</summary> ### [`v0.9.0`](https://redirect.github.com/GREsau/schemars/blob/HEAD/CHANGELOG.md#090---2025-05-26) [Compare Source](https://redirect.github.com/GREsau/schemars/compare/v0.8.22...v0.9.0) This version is identical to `1.0.0-alpha.18`, but is available for those who are unable to unwilling to use a pre-release version. Those upgrading from Schemars 0.8 may want to consult [the migration guide](https://graham.cool/schemars/migrating/), which also applies when migrating from 0.8 to 0.9. </details> --- ### Configuration 📅 **Schedule**: Branch creation - "every 2nd week starting on the 2 week of the year before 4am on Monday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/bitwarden/sdk-internal). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC42Mi4xIiwidXBkYXRlZEluVmVyIjoiNDAuNjIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel García <[email protected]>
1 parent 85f0a96 commit 1a956d4

File tree

5 files changed

+20
-19
lines changed

5 files changed

+20
-19
lines changed

Cargo.lock

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ reqwest = { version = ">=0.12.5, <0.13", features = [
5858
"multipart",
5959
"http2",
6060
], default-features = false }
61-
schemars = { version = ">=0.8.9, <0.9", features = ["uuid1", "chrono"] }
61+
schemars = { version = ">=1.0.0, <2.0", features = ["uuid1", "chrono04"] }
6262
serde = { version = ">=1.0, <2.0", features = ["derive"] }
6363
serde_bytes = { version = ">=0.11.17, <0.12.0" }
6464
serde_json = ">=1.0.96, <2.0"

crates/bitwarden-crypto/src/enc_string/asymmetric.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{fmt::Display, str::FromStr};
1+
use std::{borrow::Cow, fmt::Display, str::FromStr};
22

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

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

356356
assert_eq!(
357357
serde_json::to_string(&schema).unwrap(),
358-
r#"{"$schema":"http://json-schema.org/draft-07/schema#","title":"UnsignedSharedKey","type":"string"}"#
358+
r#"{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"UnsignedSharedKey","type":"string"}"#
359359
);
360360
}
361361
}

crates/bitwarden-crypto/src/enc_string/symmetric.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::str::FromStr;
1+
use std::{borrow::Cow, str::FromStr};
22

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

349-
fn json_schema(generator: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
349+
fn json_schema(generator: &mut schemars::generate::SchemaGenerator) -> schemars::Schema {
350350
generator.subschema_for::<String>()
351351
}
352352
}
@@ -514,7 +514,7 @@ mod tests {
514514

515515
assert_eq!(
516516
serde_json::to_string(&schema).unwrap(),
517-
r#"{"$schema":"http://json-schema.org/draft-07/schema#","title":"EncString","type":"string"}"#
517+
r#"{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"EncString","type":"string"}"#
518518
);
519519
}
520520
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! identity, which is provided by a signature keypair. This is done by signing the public key, and
33
//! requiring consumers to verify the public key before consumption by using unwrap_and_verify.
44
5-
use std::str::FromStr;
5+
use std::{borrow::Cow, str::FromStr};
66

77
use base64::{engine::general_purpose::STANDARD, Engine};
88
use serde::{Deserialize, Serialize};
@@ -152,11 +152,11 @@ impl serde::Serialize for SignedPublicKey {
152152
}
153153

154154
impl schemars::JsonSchema for SignedPublicKey {
155-
fn schema_name() -> String {
156-
"SignedPublicKey".to_string()
155+
fn schema_name() -> Cow<'static, str> {
156+
"SignedPublicKey".into()
157157
}
158158

159-
fn json_schema(generator: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
159+
fn json_schema(generator: &mut schemars::generate::SchemaGenerator) -> schemars::Schema {
160160
generator.subschema_for::<String>()
161161
}
162162
}

0 commit comments

Comments
 (0)