Make images required for Thumbnail#216
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR makes the images field required for ThumbnailCard by overriding the parent class's optional default. While the field remains nullable (can be explicitly set to None), users must now consciously provide a value rather than relying on an implicit default. The changes update the model definition and all example usage to explicitly specify image data.
Key changes:
- Modified
ThumbnailCardto require explicitimagesfield specification using Pydantic'sField(...) - Updated example code to explicitly construct
ThumbnailCardobjects with image data - Added image data to thumbnail dictionaries in example card creation functions
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/api/src/microsoft/teams/api/models/card/thumbnail_card.py | Overrides images field from BasicCard to make it required (but nullable) using Field(...), forcing explicit specification |
| packages/api/src/microsoft/teams/api/models/attachment/card_attachment.py | Removes trailing comment markers from content_type definitions (whitespace cleanup) |
| examples/message-extensions/src/main.py | Updates import organization, explicitly constructs ThumbnailCard with validation, and changes attachment layout to GRID |
| examples/message-extensions/src/cards.py | Adds explicit images array to thumbnail data dictionaries to satisfy new requirement |
lilyydu
approved these changes
Nov 21, 2025
lilyydu
added a commit
that referenced
this pull request
Nov 22, 2025
## Release 2.0.0a6 ### Changes - Make images required for Thumbnail (#216) - Revert "Add comment" - Add comment - Move tests to examples (#199) - Bump glob from 11.0.3 to 11.1.0 in /tests/tab/Web (#215) - Remove Agents class (#213) - Add signin/failure invoke activity support (#206) - Update config.yml (#214) - Adds a github template when New issues are created (#212) - feat: add OAuth support for regional bots (#209) - [feat] Add BotBuilder Plugin package, sample and tests (#190) Co-authored-by: lilydu <[email protected]>
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.
Thumbnails should have images be a required field. Without them, thumbnails scenario don't really work.
Technically it's nullable, so we allow it, but it should be explicitly specified that it's nullable.