Skip to main content

validate

Function validate 

Source
pub fn validate(
    schema: &Value,
    payload: &Value,
    options: &ResolveOptions,
) -> Result<(), ValidateError>
Expand description

Validate a payload against a UCP schema.

Resolves the schema for the given direction and operation, selects the operation shape for container-shaped capabilities, then validates the payload against the resulting schema.

§Errors

Returns ValidateError::Resolve if schema resolution or operation-shape selection fails, or ValidateError::Invalid if the payload doesn’t match.