fix: set id as optional for meeting participant events#288
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes a deserialization error for meeting participant events (meetingParticipantJoin and meetingParticipantLeave) in Microsoft Teams. According to the Microsoft Teams API specification, these event types do not include an id field in their payload, but the base Activity class requires it. The fix leverages Pydantic's field override capability to make the id field optional for MeetingParticipantEventActivity.
Changes:
- Override the
idfield inMeetingParticipantEventActivityto beOptional[str] = None - Remove trailing empty comment from
typefield declaration (minor style improvement) - Add documentation explaining that
idis optional for meeting participant events
packages/api/src/microsoft_teams/api/activities/event/meeting_participant.py
Show resolved
Hide resolved
singhk97
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pydantic was throwing an error when deserializing the incoming meeting participant activities - "id" is a required param for most incoming activities but is not required for these events. this is only a bug in python, TS/C# are working as expected.
pydantic allows for overriding in subclasses - hence I set it as
Optionaland defaultNonedocs specify expected payload for
meetingParticipantJoinandmeetingParticipantLeavehere:https://learn.microsoft.com/en-us/microsoftteams/platform/apps-in-teams-meetings/meeting-apps-apis?tabs=channel-meeting%2Cguest-user%2Cone-on-one-call%2Cdotnet3%2Cdotnet2%2Cdotnet%2Cparticipant-join-event%2Cparticipant-join-event1#receive-meeting-participant-events