Skip to content

feat(ext): add json encoder#1340

Merged
TristonianJones merged 5 commits into
cel-expr:masterfrom
rohan-patnaik:rpatnaik/cel-json-encoder
Jun 26, 2026
Merged

feat(ext): add json encoder#1340
TristonianJones merged 5 commits into
cel-expr:masterfrom
rohan-patnaik:rpatnaik/cel-json-encoder

Conversation

@rohan-patnaik

Copy link
Copy Markdown
Contributor

What changed

  • Added json.encode(dyn) -> string to ext.Encoders().
  • Uses the existing CEL JSONValueType conversion and protojson marshaling.
  • Added tests for string, list, and object values.

Why

This adds a small JSON serialization helper without pulling YAML or decoding into the same change.

Part of #1245.

Testing

  • go test ./ext -run 'TestEncoders'

Comment thread ext/encoders.go
@rohan-patnaik rohan-patnaik marked this pull request as ready for review June 16, 2026 00:55
Comment thread ext/encoders.go
@TristonianJones

Copy link
Copy Markdown
Collaborator

/gcbrun

@rohan-patnaik

rohan-patnaik commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Added the JSON encoder docs to ext/README.md.

@TristonianJones

Copy link
Copy Markdown
Collaborator

/gcbrun

Comment thread ext/encoders.go
@TristonianJones

Copy link
Copy Markdown
Collaborator

/gcbrun

@TristonianJones TristonianJones merged commit ea3d5c0 into cel-expr:master Jun 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants