If `s` is an array, return its element schema; else `None`. Tuple-typed arrays (`items: [schema, schema, …]`) and boolean-schema items are not supported and yield `None`.
(s: &'a SchemaObject)
| 210 | /// arrays (`items: [schema, schema, …]`) and boolean-schema items are not |
| 211 | /// supported and yield `None`. |
| 212 | fn array_item<'a>(s: &'a SchemaObject) -> Option<&'a SchemaObject> { |
| 213 | let arr = s.array.as_ref()?; |
| 214 | let items = arr.items.as_ref()?; |
| 215 | match items { |
| 216 | SingleOrVec::Single(b) => match b.as_ref() { |
| 217 | Schema::Object(o) => Some(o), |
| 218 | Schema::Bool(_) => None, |
| 219 | }, |
| 220 | SingleOrVec::Vec(_) => None, |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | /// If `s` is a "map type" (object with `additionalProperties` and no declared |
| 225 | /// properties — what schemars emits for `BTreeMap<String, T>`), return the |
no outgoing calls
no test coverage detected
searching dependent graphs…