feat: allow selecting payload encoding per value#87
Open
raszi wants to merge 5 commits into
Open
Conversation
Signed-off-by: KARASZI István <ikaraszi@gmail.com>
Signed-off-by: KARASZI István <ikaraszi@gmail.com>
Signed-off-by: KARASZI István <ikaraszi@gmail.com>
Signed-off-by: KARASZI István <ikaraszi@gmail.com>
fa29e6c to
e3e1505
Compare
Signed-off-by: KARASZI István <ikaraszi@gmail.com>
Closed
dotemacs
approved these changes
May 13, 2026
Contributor
dotemacs
left a comment
There was a problem hiding this comment.
This is already used in production, so yes, approving.
thenonameguy
approved these changes
May 13, 2026
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.
Summary
Allows callers to explicitly select which payload converter (nippy, json, or null) is used when serializing a value, instead of relying on the default best-match selection. This is useful when interoperating with non-Clojure Temporal workers that expect a specific encoding.
Changes
temporal.converter.encoding(new): introduces a Tagged record and with helper for annotating a value with a target encoding (:null,:nippy,:json, or a raw encoding string like"json/plain").temporal.converter.default:DefaultDataConverterthat intercepts toPayload and routes Tagged values to the requested converter, falling back to default behavior otherwise.withContextto propagateSerializationContextto a fresh proxy while reusing the original converters/failure-converter via reflection intoPayloadAndFailureDataConverter's private fields.DataConverterExceptionwith a clear message when the requested encoding has no registered converter, or when the registered converter can't encode the value.temporal.client.core: adds an encode helper that runs values through the client's configuredDataConverter.temporal.converter.optional: removes unused optional?.:null/:nippy/:json(both keyword and raw string forms), withContext propagation, and error paths for unregistered/unencodable values.Test plan
(encoding/with x :json)value through a workflow and confirm the resultingPayloadmetadata reportsjson/plain