Repository navigation
Commit 5dde801
authored
fix(block): marshal context elements from values (#1706)
Encode `ContextBlock` values correctly when passed through the `Block`
interface. Previously, pointer blocks produced the required
`"elements":[...]` array, while value blocks produced
`"elements":{"Elements":[...]}`.
Use a value receiver for `ContextElements.MarshalJSON` so both forms use
the existing array encoder. Add a regression test covering value and
pointer blocks and an Unreleased changelog entry.
Validation: the regression reproduced the incorrect JSON before the fix.
Focused block/context race tests, formatting, lint, module tidy, and
whitespace checks passed. The expected shape matches [Slack's context
block
reference](https://docs.slack.dev/reference/block-kit/blocks/context-block/).1 parent 0b8dc72 commit 5dde801
3 files changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
9 | 20 | | |
10 | 21 | | |
11 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
| 415 | + | |
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| |||
0 commit comments