microsoft / microsoft/AdaptiveCards

[Authoring] Templating doesn't support JSON keys with whitespace

Open
#9,171 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Schema Bug
Dominant language
C#
Stars
2k
Forks
595
Avg merge
1d 19h
Merged PRs (30d)
1

Description

Target Application

Teams, Copilot

Application Operating System

Windows

Schema Version

1.4

Problem Description

Given this card

{
    "type": "AdaptiveCard",
    "body": [
        {
            "type": "TextBlock",
            "text": "Product ${product}"
        },
        {
            "type": "TextBlock",
            "text": "Price ${unit price}"
        }
    ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.6"
}

and this payload

{
    "product": "Widget",
    "unit price": "$42"
}

The card does not render at all in the designer. I could not find any documentation on the differences between property names as supported in the binding syntax vs. legal JSON key names. I tried a variety of escaping techniques with no success.

Expected Outcome

A way to bind to a JSON key that contains whitespace.

Actual Outcome

Card does not render in the designer
Value is rendered as "${unit price}" in Copilot

Card JSON
{
    "type": "AdaptiveCard",
    "body": [
        {
            "type": "TextBlock",
            "text": "Product ${product}"
        },
        {
            "type": "TextBlock",
            "text": "Price ${unit price}"
        }
    ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.6"
}
Repro Steps

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the authoring templating and binding-syntax handling used by the designer, then compare it with the JSON payload and card examples in this report. Reproduce the whitespace-key case in the designer and Copilot; done means a JSON key such as "unit price" binds successfully and existing keys still render correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.