Practical guide

How to use JSONPath for freight data mapping without losing records

Declare how many matching nodes a mapping expects. No match is not a JSON null, and multiple matches must not silently become the first value. When a list is intentional, keep each value linked to the shipment or stop it came from.

Test selection separately from validation

The query locates nodes; the business rule decides what is acceptable.

RFC 9535 defines JSONPath queries and their results as node lists. Use syntax supported by the agreed profile. Define expected cardinality, value type and the scope of the record outside the query. Record a safe indication of the selected location for error review without disclosing unrelated shipment data.

Worked example

A selector finds two delivery references for a single-value field.

A synthetic payload contains two delivery stops. A selector finds a reference on each, but the receiving field expects one. Do not select the first as a default. Either use a confirmed stop identifier to select the intended record or report the mismatch. If the receiver supports a list, map each reference with its stop.

Acceptance checks

Check empty matches, null and multiple matches explicitly.

Related resources

Continue with a scoped check.

Review mapping and contract tooling

Check semantic meaning separately from node selection

Software direction

Make transport data issues visible before the handoff.

Explore the public demo and compare proposed software plans. Paid access is not open yet.

Compare plans