Skip to content

Conversation

@heyitsaamir
Copy link
Collaborator

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 ThumbnailCard to require explicit images field specification using Pydantic's Field(...)
  • Updated example code to explicitly construct ThumbnailCard objects 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

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