Skip to content

fix(dataEvents): widen event metadata typing beyond string#586

Open
pkubicki wants to merge 1 commit into
mainfrom
fix/data-event-metadata-typing
Open

fix(dataEvents): widen event metadata typing beyond string#586
pkubicki wants to merge 1 commit into
mainfrom
fix/data-event-metadata-typing

Conversation

@pkubicki

@pkubicki pkubicki commented Jul 14, 2026

Copy link
Copy Markdown

Why?

Event metadata is typed as a string-only map in the generated SDKs (Record<string, string>), but the Events API accepts more value types (number, date, link, rich link, monetary amount) and applies no per-type validation. The strict type forces users to stringify non-string values.

How?

Widen create_data_event_request.metadata and data_event.metadata to additionalProperties: true in the stable and preview overrides. Override-only; no runtime change.

Generated with Claude Code

Event metadata accepts string, number, date, link, rich link, and monetary
amount values (per public docs and server-side handling), but the OpenAPI
schemas restrict it to additionalProperties.type: string, generating metadata
as Record<string, string> in the SDKs. Widen create_data_event_request.metadata
and data_event.metadata to additionalProperties: true in both the stable (2.14)
and preview overrides so generated SDKs type it as Record<string, unknown>.

Co-Authored-By: Claude <noreply@anthropic.com>
@pkubicki pkubicki force-pushed the fix/data-event-metadata-typing branch from 35003d4 to de7ca09 Compare July 14, 2026 15:29

@3assy2018 3assy2018 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Rigor
Static review of the override diff only — no local Intercom-OpenAPI checkout, so I didn't regenerate SDKs; checked the board (no existing issue) and no Shrek review is present.

✅ What's good
Widening is scoped to the override layer and mirrors the documented custom_attributes precedent, so base specs and the served contract stay untouched — genuinely zero-runtime-risk.

🧭 Verdict
Clean, well-reasoned, low-risk — happy to approve. Nice touch citing the Fern-migration regression and the precedent in the description.

📋 Findings

  • [Question] additionalProperties: true types metadata as Record<string, unknown> — broader than the six documented value types and drops the string hint even for plain strings. Reads deliberate (and matches custom_attributes); flagging only so SDK consumers know they'll now cast rather than get a typed union. Worth a union later?

🧪 Verification Notes
No local checkout, so I read the YAML diff + PR reasoning rather than regenerating SDKs. The stable override edits 3 existing metadata blocks + adds a fresh data_event entry, but the body names 2 schemas (create_data_event_request, data_event) — a 5-sec glance that the 3rd edited block is intentional would close the loop (couldn't resolve schema names without the checkout). Preview overrides add both schemas as property-level overrides, consistent with the merge model.


~ Automated via Claude · Mohamed's autonomous reviewer

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