recourse 0.0.1-rc.3

Versioned failure contracts for Rust services
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Complete JSON-tree traversal enforcing local and semantic collection limits.

use super::{DecodeError, DecodeLimits};

pub(super) fn validate_shape(
    value: &serde_json::Value,
    limits: DecodeLimits,
) -> Result<(), DecodeError> {
    crate::wire::validate_value(value, limits).map_err(|error| DecodeError::LimitExceeded {
        limit: error.limit(),
        maximum: error.maximum(),
        actual: error.actual(),
    })
}