diff --git a/proxmox-schema/src/schema.rs b/proxmox-schema/src/schema.rs index 322a90c9..a8598a6c 100644 --- a/proxmox-schema/src/schema.rs +++ b/proxmox-schema/src/schema.rs @@ -198,6 +198,11 @@ impl BooleanSchema { } } + pub const fn description(mut self, description: &'static str) -> Self { + self.description = description; + self + } + pub const fn default(mut self, default: bool) -> Self { self.default = Some(default); self @@ -240,6 +245,11 @@ impl IntegerSchema { } } + pub const fn description(mut self, description: &'static str) -> Self { + self.description = description; + self + } + pub const fn default(mut self, default: isize) -> Self { self.default = Some(default); self @@ -316,6 +326,11 @@ impl NumberSchema { } } + pub const fn description(mut self, description: &'static str) -> Self { + self.description = description; + self + } + pub const fn default(mut self, default: f64) -> Self { self.default = Some(default); self @@ -420,6 +435,11 @@ impl StringSchema { } } + pub const fn description(mut self, description: &'static str) -> Self { + self.description = description; + self + } + pub const fn default(mut self, text: &'static str) -> Self { self.default = Some(text); self @@ -537,6 +557,11 @@ impl ArraySchema { } } + pub const fn description(mut self, description: &'static str) -> Self { + self.description = description; + self + } + pub const fn min_length(mut self, min_length: usize) -> Self { self.min_length = Some(min_length); self