Skip to content

Commit 60712ad

Browse files
committed
refactor: Use json_schema! macro
1 parent e6e2d7f commit 60712ad

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

rust/operator-binary/src/crd/v1alpha1_impl.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use snafu::Snafu;
44
use stackable_operator::{
55
k8s_openapi::api::core::v1::{ConfigMap, Secret},
66
kube::api::PartialObjectMeta,
7-
schemars::{Schema, SchemaGenerator},
7+
schemars::{Schema, SchemaGenerator, json_schema},
88
shared::time::Duration,
99
};
1010

@@ -150,15 +150,14 @@ impl CertificateKeyGeneration {
150150
// - '4096'
151151
// type: string
152152
pub fn tls_key_length_schema(_: &mut SchemaGenerator) -> Schema {
153-
serde_json::from_value(serde_json::json!({
153+
json_schema!({
154154
"type": "integer",
155155
"enum": [
156156
Self::RSA_KEY_LENGTH_2048,
157157
Self::RSA_KEY_LENGTH_3072,
158158
Self::RSA_KEY_LENGTH_4096
159159
]
160-
}))
161-
.expect("Failed to parse JSON of custom tls key length schema")
160+
})
162161
}
163162
}
164163

0 commit comments

Comments
 (0)