diff --git a/src/api/schema.rs b/src/api/schema.rs index 0142a2b8..99caa8c4 100644 --- a/src/api/schema.rs +++ b/src/api/schema.rs @@ -141,6 +141,8 @@ impl StringSchema { pub struct ArraySchema { pub description: &'static str, pub items: Arc, + pub min_length: Option, + pub max_length: Option, } impl ArraySchema { @@ -149,8 +151,20 @@ impl ArraySchema { ArraySchema { description: description, items: item_schema, + min_length: None, + max_length: None, } } + + pub fn min_length(mut self, min_length: usize) -> Self { + self.min_length = Some(min_length); + self + } + + pub fn max_length(mut self, max_length: usize) -> Self { + self.max_length = Some(max_length); + self + } } #[derive(Debug)]