Skip to main content

apply_result_path

Function apply_result_path 

Source
pub fn apply_result_path(
    input: &Value,
    result: &Value,
    path: Option<&str>,
) -> Result<Value, StatesError>
Expand description

Apply ResultPath to merge a state’s result into the input.

  • None or Some("$") -> result replaces input entirely
  • Some("null") -> discard result, return original input
  • Some("$.foo") -> set result at that path within input

A path that walks into a value that can’t hold its next step ($.a.b with a: 1) fails with States.ReferencePathConflict, as recorded.