You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Support RFC 9535 JSON Path syntax and prune dependencies (#11)
Reference: https://pkg.go.dev/github.com/wasilibs/go-re2
Reference: https://spec.openapis.org/arazzo/v1.0.1#criterion-expression-type-object
The first change to remove the `github.com/wasilibs/go-re2` Go module dependency is purely for binary size considerations. It adds 2.49 MB by itself, plus its dependencies, to binary size. As noted by its README:
> Note that if your regular expressions or input are small, this library is slower than the standard library. You will generally "know" if your application requires high performance for complex regular expressions, for example in security filtering software. If you do not know your app has such needs, you should turn away now.
If regular expression parsing speed is a real concern, a separate Go submodule with the swapped dependency might be a better implementation so its opt-in for consumers.
The second change replaces `k8s.io/client-go/util/jsonpath` with `github.com/speakeasy-api/jsonpath`. When this Go module was initially created, RFC 9535 compatible libraries did not exist yet. This change ensures RFC 9535 compliance, which is noted in the Arazzo version 1.0.1 specification as what should be the default when Criterion Expression Type Object (and its `version`) is not specified, which is the most common use case. If handling `version: draft-goessner-dispatch-jsonpath-00` is absolutely required, then a separate feature request should be created for consideration.
Additional test validation ignores are added for legitimate RFC 9535 syntax issues (e.g. those criterion without explicit `version: draft-goessner-dispatch-jsonpath-00`) and the opposite now-unsupported `version: draft-goessner-dispatch-jsonpath-00`.
0 commit comments