microsoft / microsoft/teams.ts

[cards] support lowercase and Capitalized JSON values

Open
#132 3 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
TypeScript
Stars
107
Forks
39
Avg merge
1d 7h
Merged PRs (30d)
74

Description

Currently, the official [Adaptive Cards Designer](https://adaptivecards.microsoft.com/designer.html) uses enum values for validating the JSON, meaning that `spacing: "left"` will cause a linter warning in the AC designer but `spacing: "Left"` will pass.

In the old Adaptive Cards designer, all lowercase values were supported as opposed to capitalized values, which is part of why the cards package lints for lowercase.

Ultimately, either works - capitalized or lowercase, either/both will successfully be rendered in Teams over the wire, but to avoid confusion for the conflicting linter messages, this SDK should support both. (This is why the work item is lower priority)

Adaptive Cards Designer, lowercase:

![Image](https://github.com/user-attachments/assets/cf99475e-6f48-48c6-a6ff-4cf3d3972915)

AC Designer, capitalized:

![Image](https://github.com/user-attachments/assets/5882f7d8-5a1c-4b6c-929f-84cd349c3b7d)

Linter when using `ICard` from `cards` package:

![Image](https://github.com/user-attachments/assets/c5abed09-74d1-43c6-8418-7d2fda2c362a)

Contributor guide

Open the contributing guide

Research direction

Start by locating the cards package definitions for ICard and the enum values used in its JSON validation. Check any existing cards tests for lowercase values, then add coverage for both lowercase and capitalized forms; done means both forms pass validation without linter warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.