pub fn detect_items(value: Value) -> Result<ItemsDetection, FaceError>Expand description
Run §4.2 items detection over a parsed JSON Value.
§Errors
FaceError::AmbiguousDetectionwhen the root object has multiple array-valued fields and none match the named candidates.FaceError::InputParsewhen the root is a scalar (the input is not an item-bearing shape).
§Examples
use face_core::input::items::detect_items;
use serde_json::json;
let detection = detect_items(json!({"items": [1, 2, 3]})).unwrap();
assert_eq!(detection.items_path, ".items");
assert_eq!(detection.items.len(), 3);