ohler55/ojg

Maybe a regression on path filters on version 1.18.0

20010930 opened this issue · 3 comments

Hello,

I think there is a regression in the version [1.18.0].
Issue in

  • "op": "replace",
  • "path": "$.test[?(@.name == 'api-test-go' && @.qualifier == null)].tag",
  • "value": "v1.8.0"

When i try to update the field using the Set method in set.go ;).

func (x Expr) Set(data, value any) error {
	return x.set(data, value, "set", false)
}

More precisely the param @.qualifier == null seems to be the issue. In my case I can use this synthax in the latest version of the library !@.qualifier to make it work.

I would call the change a bug fix. It's noted in the release notes in the CHANGELOG.md file. The reason for that is that the https://datatracker.ietf.org/doc/draft-ietf-jsonpath-base draft use Nothing to indicate a field is missing which makes sense as null is a valid value. So @.qualifier == null should return true if the qualifier has a value of null.

I'm not sure what the data looks like but does that describe your situation?

Indeed it describe it ;).

So, all good? Can this be closed?