Open
Conversation
Copilot
AI
changed the title
[WIP] Add JSONata function with custom CEL expressions support
Add JSONata template evaluation via gnata
Mar 28, 2026
be082e8 to
ba89ebb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds JSONata 2.x expression evaluation as a first-class option on the
Templatestruct, backed by github.com/recolabs/gnata. Custom gomplate functions are exposed in the JSONata environment; gnata's native built-ins take precedence on any name collision.TemplatestructJsonata stringfield (yaml:"jsonata",json:"jsonata")RunTemplateContextevaluates theJsonatafield after the existing CEL pathIsEmpty,CacheKey,String,ShortStringupdated accordinglyjsonata.go— new filegnataBuiltinFunctionsset guards against overriding native JSONata semanticsgetJSONataCustomFuncs()exposes gomplate-specific functions asgnata.CustomFuncwrappers, skipping any name in the builtin set:$sha1/$sha224/$sha256/$sha384/$sha512/$sha512_224/$sha512_256$toJSON/$fromJSON/$toYAML/$fromYAML$jq/$jmespath/$jsonpath$regexpFind/$regexpFindAll/$regexpMatch/$regexpReplace/$regexpReplaceLiteral/$regexpSplit$f— go-template format string (mirrors the CELf()function)customJSONataEnvinitialized once at startup; expressions are cached per-expression stringUsage
Tests (
tests/jsonata_test.go)New test suite mirroring the existing CEL tests: basic path/arithmetic, built-in string/array/math/object functions, all custom gomplate functions, and a precedence test confirming gnata native functions cannot be shadowed.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.