Skip to main content

validate

Function validate 

Source
pub fn validate(
    suffix: &str,
    payload: Option<&Value>,
) -> Result<(), PredicateError>
Expand description

Validate a receipt payload against the registered schema for suffix.

  • If suffix is not registered, returns Ok(()) (backward compatible: the receipt attests sign-on-submit, exactly as before).
  • If suffix is registered, the payload must be a JSON object that carries every required field and whose present fields match their declared primitive types. A missing payload is treated as the empty object and therefore fails any predicate that has required fields.