Class JsonPathDsl
DSL extension that wires a JsonPath query into a route step. Reads
{"json":"<document>","path":"$.foo[0].bar"} from
exchange.In.Body, evaluates the path against the embedded document
and writes the matched value (re-serialised as JSON) — or the literal
null when nothing matched — to exchange.Out.Body.
Uses Newtonsoft JToken.SelectToken / SelectTokens directly,
the same engine that backs
redb.Route.Expressions.JsonPathExpression (which is built for
in-route property extraction and trips on the JValue → JToken path
for primitives). The full Newtonsoft JsonPath dialect is supported:
recursive descent (..), wildcards ([*]), filters
([?(@.foo == 1)]), slicing ([1:5]).
From("direct:llm.json_path")
.AsLlmTool("json_path").Description("Query a JSON document.").Then()
.JsonPath(new JsonPathOptions());
public static class JsonPathDsl
Inheritance
Methods
JsonPath(IRouteDefinition, JsonPathOptions?)
Adds a JsonPath query step. Uses default options when options is null.
public static IRouteDefinition JsonPath(this IRouteDefinition self, JsonPathOptions? options = null)