ohler55 / ojg

Optimized JSON for Go
MIT License
857 stars 49 forks source link

Maybe a regression on path filters on version 1.18.0 #132

Closed 20010930 closed 1 year ago

20010930 commented 1 year ago

Hello,

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

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.

ohler55 commented 1 year ago

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?

20010930 commented 1 year ago

Indeed it describe it ;).

ohler55 commented 1 year ago

So, all good? Can this be closed?