Fix choices_data alias to use "choices.data" instead of "choicesData"#224
Conversation
Co-authored-by: heyitsaamir <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR fixes the serialization alias for the choices_data field in ChoiceSetInput to use "choices.data" instead of the default camelCase "choicesData", ensuring compliance with the Adaptive Cards specification.
Key changes:
- Added special case handling for
choices_data→"choices.data"in both validation and serialization alias generators - Added comprehensive test coverage for serialization and deserialization round-trip
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/cards/src/microsoft/teams/cards/core.py | Added special alias handling for choices_data field in both validation_alias_generator and serialization_alias_generator methods, following the existing pattern used for ms_teams |
| packages/cards/tests/test_core_serialization.py | Added test test_choices_data_serializes_to_choices_dot_data() to verify proper serialization to "choices.data" and deserialization round-trip, plus imported necessary types |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
|
when is the plan to merge it ? |
|
@heyitsaamir this will still fail on search with dataset that come form the app Because the app not support yeat 'application/search when i added the missing types is work well 🚀 we can extend the on_invoke event |
Thanks @aviadpriel ! Would you mind putting up a PR with that? @aacebo iirc you had added this somewhere right? |
## Release 2.0.0a7 ### Changes - update react and react-dom to 19.2.1 (#233) - Move to microsoft_teams namespace (#226) - Simplify setting http response after activity processing (#218) - Add TeamsChannelAccount type for Teams-specific APIs (#230) - Updating mcpplugin reference in README.md (#229) - Bring back bot builder example (#225) - Fix choices_data alias to use "choices.data" instead of "choicesData" (#224) - [docs] botbuilder package README fixes (#223) - Fix calling AI functions with no parameters (#221)

The
choices_datafield inChoiceSetInputwas incorrectly serializing to"choicesData"(default camelCase) instead of"choices.data"per the Adaptive Cards spec.Changes
SerializableObject.validation_alias_generatorandserialization_alias_generatorforchoices_data→"choices.data"Example
Follows existing pattern for
ms_teams→"msteams".Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
login.microsoftonline.com/home/REDACTED/work/teams.py/teams.py/.venv/bin/pytest pytest packages -x(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.