Skip to content

Use protojson marshaling for payload HTTP handler response#2315

Merged
jmaeagle99 merged 3 commits intotemporalio:mainfrom
jmaeagle99:codec-server-proto-json-resp
Apr 29, 2026
Merged

Use protojson marshaling for payload HTTP handler response#2315
jmaeagle99 merged 3 commits intotemporalio:mainfrom
jmaeagle99:codec-server-proto-json-resp

Conversation

@jmaeagle99
Copy link
Copy Markdown
Contributor

@jmaeagle99 jmaeagle99 commented Apr 29, 2026

What was changed

Update the payloadHTTPHandler to write response as Protobuf JSON (according to codec server spec) instead of as plain JSON.

Why?

The codec server spec says that requests and responses should be interpreted with Protobuf JSON encoders.

The main observable difference is that plain JSON encoding would use snake_case for field names whereas Protobuf JSON uses camelCase for field names. This hasn't been an issue in the past because Payloads and Payload messages have property names that were only one word, thus the same in camelCase and snake_case.

With the introduction of the external_payloads field on the Payload protobuf message and the size_bytes field on the ExternalPayloadDetails protobuf message, these fields are being written as snake_case when serializing as plain json. The Web UI is expecting camelCase properties.

Brief testing with the Web UI and inspection of the code shows that this works. The Temporal CLI is already using NewRemotePayloadCodec from sdk-go, which is using protojson.Unmarshal on the response.

Checklist

  1. How was this tested:
  • Tested with existing WebUI.
  • Inspect Temporal CLI for conformance.
  1. Any docs updates needed? No

@jmaeagle99 jmaeagle99 requested a review from a team as a code owner April 29, 2026 04:16
Comment thread converter/payload_handler.go
@jmaeagle99 jmaeagle99 enabled auto-merge (squash) April 29, 2026 18:35
@jmaeagle99 jmaeagle99 merged commit a27c0b4 into temporalio:main Apr 29, 2026
57 of 58 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