Scrivio Interview library
LeadershipPrincipal7 min read · updated 12 November 2026

JSONPath had many incompatible implementations for years and was standardised as RFC 9535 in 2024. Your platform exposes JSONPath in alerting rules, API gateway policies and data pipelines. What do you do about it?

First we find out what we actually run: every place a JSONPath expression is stored and which engine evaluates it. Then we identify where those engines differ from RFC 9535 in filter syntax, functions and deep-scan results, adopt RFC semantics for new features, and give teams a validator and a migration tool for existing expressions. Stored rules carry a version of the expression language so old rules keep their meaning during the move, and where an expression only addresses one value, we consider JSON Pointer, which is simpler and already standard.

Why this question is asked

JSONPath spent seventeen years as an informal idea from a 2007 blog article, implemented differently by dozens of libraries, before the IETF published RFC 9535 in 2024. A platform that lets users write JSONPath in alert rules, gateway policies and pipelines has quietly made those differences part of its product: the same expression can match different data depending on which component evaluates it. Interviewers ask this at the most senior level to see whether we can manage a language migration that touches customers' stored logic without breaking it. In this answer, we will recap why the implementations diverged, take stock of our own usage, compare the engines with the RFC, plan the migration with versioned rules and tooling, and look at where JSON Pointer is the better tool.

1A Quick Recap of Why JSONPath Diverged

JSONPath began as a short description, modelled on XPath, with examples rather than a grammar. Each library filled the gaps in its own way. Some allowed filters written as [?(@.price < 10)] and others only [?@.price < 10]; some offered functions like length() at the end of a path, others inside filters, others not at all; some returned a single value for a definite path and a list otherwise, while others always returned lists. Even the deep scan .. produced results in different orders, and sometimes with duplicates.

RFC 9535 finally defines a grammar and exact semantics. It describes the result of a query as a nodelist, defines comparison rules across types, adds standard functions such as length(), count(), match(), search() and value() for use in filters, and specifies regular expressions through I-Regexp (RFC 9485). Many engines, including Jayway JsonPath in Java, predate it and are not fully compliant, so check each engine's documentation for an RFC mode.

2Inventory Expressions and Engines

We cannot migrate what we have not found. The inventory answers two questions for every place JSONPath appears: where are the expressions stored, and which engine and version evaluates them? In our platform that might be alert rules in a configuration database evaluated by a Java service using Jayway, gateway policies evaluated by the gateway's own engine, and pipeline steps in YAML evaluated by a data tool with yet another implementation.

Alongside the engines, we export the expressions themselves. Even a rough count matters: if 92 percent of 40,000 stored expressions are plain paths like $.order.total, the migration is mostly mechanical, and our effort goes into the few thousand with filters and functions.

Example inventory
WhereEngineExpressionsUses filters or functions
Alerting rules (DB)Jayway JsonPath in Java18,000about 9 percent
API gateway policiesgateway built-in engine6,500about 3 percent
Data pipelines (YAML)pipeline tool engine15,500about 11 percent
Illustrative numbers; the real inventory comes from exports of each store.

3Find Where the Engines Differ From the RFC

Next we compare behaviour, not documentation. We build a corpus of sample documents and run every distinct expression through each current engine and through an RFC 9535 compliant engine, recording the results. Expressions whose results match everywhere are safe. The rest fall into a few families.

Java
Expression Jayway JsonPath RFC 9535
$.items.length() 3 syntax error (length() is a filter function)
$.items[?(@.sku =~ /A.*/)] matches by regex syntax error; use match(@.sku, 'A.*')
$.items[?@.price < 10] error in older versions valid
$.items[?(@.price < '10')] engine specific false (no comparison across types)
$.items[0].sku "A" (single value) nodelist with one node

Notice that some differences are only syntax, and a tool can rewrite them, while others are semantic: an expression that is valid in both engines but selects different nodes. Comparisons between a number and a string, for instance, are simply false in the RFC, while older engines may convert types. The semantic cases are the dangerous ones, because nothing fails; an alert just stops firing.

4Adopt the RFC for New Work, With Tools for the Old

For new features and new rules, the platform accepts only RFC 9535 syntax and semantics, ideally through one shared evaluation library used by every component so that alerting, the gateway and pipelines cannot drift apart again. If a component cannot use the shared library, it must pass the same conformance test suite; the JSONPath working group publishes a compliance test suite that is a good starting point.

For existing expressions we give teams two tools. A validator, in the rule editor and in CI, parses each expression with the RFC grammar and reports whether it is portable, needs a rewrite or changes meaning. A migration tool rewrites the mechanical cases automatically, such as moving .length() into a function call or turning =~ into match(), and for every rewrite it runs the old and new expressions against recorded sample payloads and shows any difference in results before anything is saved.

Step throughMigrating one stored rule
  1. Parse with the RFC grammarvalidator
  2. Valid and same results on samples?
    YesMark as RFC, no change neededNoTry an automatic rewrite
  3. Rewrite gives the same results?
    YesSave new version as RFCNoSend to the owning team for review
  4. Old version kept until the new one is confirmedboth versions stored

4 steps in order. Play them, or step through them one at a time.

5Version the Expression Language in Stored Rules

The key safety mechanism is that every stored rule says which language it is written in, for example lang: jsonpath-legacy-jayway or lang: jsonpath-rfc9535. The evaluator picks the engine based on that field. Old rules keep their exact current meaning until someone migrates them, new rules are RFC by default, and we can measure progress simply by counting rules per language version.

With versioning in place, the migration has no big-bang date. We can move the low-risk majority automatically, let teams review the rest at their own pace, and set a deadline for retiring the legacy engine only when the count of legacy rules is small enough to handle by hand. Customers who wrote their own rules get the validator's report and a clear timeline rather than a silent change in behaviour.

6Where JSON Pointer Is the Better Tool

Many of our expressions probably do something very simple: address one value, such as $.order.customer.id. For that job, JSON Pointer (RFC 6901), written /order/customer/id, is simpler and has been standard since 2013. It has no filters, no wildcards and no functions, so it has no ambiguity: it either finds exactly one value or none. It is also what JSON Patch uses.

So the policy can say: use JSON Pointer when a rule needs one value, and JSONPath only when it really needs to select several nodes or filter. That shrinks the surface where JSONPath differences can ever matter again.

7Follow-up questions

Why not just switch every engine to RFC mode on one date?

Because some expressions would change meaning without any error. An alert whose filter compared a number with a string might stop firing, and nobody would notice until an incident went undetected. Versioned rules and side-by-side result comparison turn those silent changes into visible review items.

What do you do with expressions whose results differ and whose owner has left?

They go into a queue owned by the platform team, sorted by impact: alerting and security policies first. For each one we look at what the rule was evidently meant to do, write the RFC version, and run both in shadow mode for a period, alerting the platform team rather than customers when they disagree.

Does Jayway JsonPath support RFC 9535?

Jayway predates the RFC and implements its own dialect, including path functions like length() and operators like =~, so it is not a drop-in RFC engine. Check the current release notes; otherwise use an RFC compliant library for the new language version and keep Jayway behind the legacy version until it can be retired.

8Conclusion

In this answer, we treated JSONPath as a language our platform exposes, not a library detail. We inventoried where expressions are stored and which engine evaluates each, compared engines against RFC 9535 on real sample documents, and separated mechanical syntax differences from silent semantic ones. We adopted the RFC for new work with one shared engine, gave teams a validator and a migration tool that proves results are unchanged, versioned the language in every stored rule so old rules keep their meaning, and steered single-value lookups to JSON Pointer.

What to say in the interviewAbout 90 seconds aloud

Open with

I would treat this as migrating a language that customers have written logic in, so the rule is that nothing may change meaning silently. First, an inventory: every place expressions are stored, alerting rules, gateway policies and pipeline definitions, and which engine and version evaluates each one, plus an export of the expressions so we know how many use filters or functions.

Then, if they want more

Usually most are plain paths and safe. Second, I would compare behaviour by running every distinct expression against sample documents in each current engine and in an RFC 9535 compliant engine. Some differences are syntax, like Jayway's length() at the end of a path or its regex operator, which the RFC replaces with functions inside filters.

Others are semantic, like comparisons across types, and those are the dangerous ones because an alert just stops firing.

Third, new features accept only RFC syntax, ideally through one shared evaluator so the components cannot drift again, and existing rules get a validator in the editor and in CI and a migration tool that rewrites the mechanical cases and proves the results are unchanged on recorded payloads.

Fourth, every stored rule carries a language version, legacy or RFC, so the evaluator picks the right engine and old rules keep their meaning until migrated. Finally, I would push single-value lookups to JSON Pointer, which is simpler, unambiguous and already standard.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "JSONPath had many incompatible implementations for years and was standardised as RFC...": https://scrivio-interview-library.netlify.app/java/json-libraries/6003349c6f/