Skip to content

Preserve ContentBlock metadata during JSON serialization - #55

Open
abietic wants to merge 1 commit into
coder:mainfrom
abietic:codex/fix/content-block-common-fields
Open

Preserve ContentBlock metadata during JSON serialization#55
abietic wants to merge 1 commit into
coder:mainfrom
abietic:codex/fix/content-block-common-fields

Conversation

@abietic

@abietic abietic commented Aug 29, 2026

Copy link
Copy Markdown

Summary

  • preserve _meta and annotations when the generated ContentBlock.MarshalJSON shapes each wire variant
  • update the generator so the fix survives schema regeneration
  • cover text, image, audio, resource-link, and embedded-resource variants

Without this, unmarshalling a valid content block and marshaling it again silently drops standard annotation data and reserved extension metadata.

Verification

  • GOTOOLCHAIN=go1.21.13 go test ./...
  • GOTOOLCHAIN=go1.21.13 go test -race ./...
  • GOTOOLCHAIN=go1.21.13 go -C cmd/generate test ./...
  • regenerated twice and confirmed an identical diff
  • git diff --check

@abietic

abietic commented Aug 30, 2026

Copy link
Copy Markdown
Author

@ThomasK33 When you have a chance, could you review this wire-compatibility fix? I have now verified the root and generator modules, including -race, with the repository minimum Go 1.21.13 toolchain.

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.

1 participant