microsoft / microsoft/AdaptiveCards

[Templating] AdaptiveCard.Templating should not be using custom json antlr parser

Open
#6,078 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Target Platform

  • dotnet

Problem Description

If you do a

{  
      "$when" : "x > 3"
}

the templating engine will output incorrect JSON

{  
       "x > 3"
}

Looking at the code I was surprised to see an custom antlr generated parser for JSON. This despite the fact that the dotnet libraries already have a dependency on JSON.NET. The current implementation of the templating library is over 200k. AdaptiveExpressions already has a parser to handle interpolated strings, as well as the ability to correctly return native types (via = syntax) and interpolated syntax ( ${path} syntax ).

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 locating the AdaptiveCard.Templating custom ANTLR-generated JSON parser and its AdaptiveExpressions integration. Verify the existing JSON.NET dependency and preserve the documented $when, native-type (=), and interpolated (${path}) behavior; done means the example produces valid JSON without the custom parser.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.