Skip to content

fix(go_server): Serialize nil string_list metrics as empty arrays instead of null#837

Merged
akkomar merged 2 commits intomainfrom
ads_backend_string_list_null
Mar 17, 2026
Merged

fix(go_server): Serialize nil string_list metrics as empty arrays instead of null#837
akkomar merged 2 commits intomainfrom
ads_backend_string_list_null

Conversation

@akkomar
Copy link
Member

@akkomar akkomar commented Mar 17, 2026

Go nil slices serialize to JSON null which fails Glean schema validation (expected JSONArray). Add nil-coalescing in generated Record functions so omitted string_list fields produce [] instead of null.

Pull Request checklist

  • Quality: This PR builds and tests run cleanly
    • make test runs without emitting any warnings
    • make lint runs without emitting any errors
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry to CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to language binding APIs are noted explicitly

…tead of null

Go nil slices serialize to JSON null which fails Glean schema validation (expected JSONArray). Add nil-coalescing in generated Record functions so omitted string_list fields produce [] instead of null.
@akkomar akkomar marked this pull request as ready for review March 17, 2026 17:32
@akkomar akkomar requested a review from a team as a code owner March 17, 2026 17:32
@akkomar akkomar requested review from badboy and removed request for a team March 17, 2026 17:33
Copy link
Member

@travis79 travis79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a brief CHANGELOG.md entry for this, to help document the fix and r+ from me.

@akkomar akkomar merged commit 5dc1d20 into main Mar 17, 2026
8 checks passed
@akkomar akkomar deleted the ads_backend_string_list_null branch March 17, 2026 17:43
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.

4 participants