python-intercom
python-intercom copied to clipboard
Event metadata validation is too strict
CreateDataEventRequest models (CreateDataEventRequestWithId, CreateDataEventRequestWithUserId, CreateDataEventRequestWithEmail) only accept string metadata, conflicting with Intercom’s documented metadata types (strings, numbers, Unix timestamps, rich links, monetary amounts).
Steps to reproduce
- Instantiate any variant with non-string metadata:
from intercom.types import CreateDataEventRequestWithUserId
CreateDataEventRequestWithUserId(
user_id="123",
event_name="test-event",
created_at=1671028894,
metadata={"load": 3.67},
)
- Observe
ValidationErrorbecause metadata.load is not a string.
Expected behaviour
Allow every metadata type listed at https://developers.intercom.com/docs/references/rest-api/api.intercom.io/data-events/createdataevent.
Actual behaviour
Validation forces all metadata values to be plain strings.
Suggested Fix
Relax the metadata value type in all CreateDataEventRequest* models (e.g., use typing.Any or a union covering the documented types) so the SDK aligns with Intercom’s API specification.