The current logic for finding !ref(...) expressions:
for (const match of input.matchAll(/\!ref\((\$.[\w\.]+)\)/g)) {
doesn’t correctly detect all valid JSONPath references especially those that use bracket notation or quoted keys eg
Example that doesn’t work:
test !ref($.state['testkeyhere'].result.url)
Proposed fix
for (const match of input.matchAll(/\!ref\((\$.[\w\.\[\]'"@?!=()_\-]+)\)/g)) {
This version supports [ ] ' characters used in JSONPath