Skip to main content

Module jsonpath

Module jsonpath 

Source
Expand description

JSONPath evaluation for Amazon States Language paths.

Step Functions evaluates InputPath, OutputPath, ItemsPath, the .$ fields of Parameters / ResultSelector / ItemSelector, Choice Variables and intrinsic arguments with Jayway JsonPath. This module implements the same syntax and the same result shape:

  • dot and bracket child access: $.a.b, $['a'], $["a"], $['a','b']
  • array indexes, including negative ones and unions: [0], [-1], [0,2]
  • wildcards .* / [*], slices [1:3], [:2], [-2:], deep scan ..x
  • filters [?(@.price < 10 && @.tag == 'x')], [?(@.isbn)]

A definite path (only single names and single indexes) yields one value and fails when nothing is found, which Step Functions surfaces as a States.Runtime error. Any other path is indefinite and yields a JSON array of every match (possibly empty).

Structs§

JsonPath
A parsed JSONPath.

Enums§

PathError
Why a path could not be evaluated.
Step
One step of a reference path.

Functions§

evaluate
Parse and evaluate in one step.