Files
Collin Van DyckandGitHub 43604173f9 fix: Ensure JSONPBEncoder terminates empty slice with ]. (#8664)
## What changed?

This fixes an issue in the `JSONPBEncoder` which does not close the
opening `[` with a `]` when encoding an empty slice. The fix was to move
the line which emitted `]` outside of the for loop.

## Why?

While working on another project which uses the `JSONPBEncoder` I saw
that an empty slice was getting encoded as `[`.

## How did you test it?
- [x] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)

## Potential risks

I'm not too familiar with the OSS temporal code, but I would not imagine
there would be anything that would be dependent on invalid json being
emitted.
2025-11-20 15:12:27 -05:00
..