If `s` is a "map type" (object with `additionalProperties` and no declared properties — what schemars emits for `BTreeMap `), return the value schema. Else `None`.
(s: &'a SchemaObject)
| 225 | /// properties — what schemars emits for `BTreeMap<String, T>`), return the |
| 226 | /// value schema. Else `None`. |
| 227 | fn map_value<'a>(s: &'a SchemaObject) -> Option<&'a SchemaObject> { |
| 228 | let obj = s.object.as_ref()?; |
| 229 | if !obj.properties.is_empty() { |
| 230 | return None; |
| 231 | } |
| 232 | let ap = obj.additional_properties.as_deref()?; |
| 233 | match ap { |
| 234 | Schema::Object(o) => Some(o), |
| 235 | Schema::Bool(_) => None, |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | /// Find the (property-name, const-value) pair that identifies a tagged-union |
| 240 | /// variant inside `vo`. schemars represents `#[serde(tag = "X")]` as a single |
no outgoing calls
no test coverage detected
searching dependent graphs…