Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Authoring] [dotnet] AdaptiveRefresh class does not serialize correctly #6862

Closed
pschaeflein opened this issue Jan 3, 2022 · 3 comments · Fixed by #7107
Closed

[Authoring] [dotnet] AdaptiveRefresh class does not serialize correctly #6862

pschaeflein opened this issue Jan 3, 2022 · 3 comments · Fixed by #7107

Comments

@pschaeflein
Copy link

Target Application

BotFramework

Application Operating System

Windows

Schema Version

1.4

Problem Description

An adaptive card that has a refresh attribute is not serialized correctly. The Action and UserIds properties are serialized in initial case instead of lower case.

When the card is sent as an attachment in BotFramework, the response indicates an error:

{
  error: {
    code: 'BadSyntax', 
    message: 'Payload is incorrect' 
  }
}

Expected Outcome

{
  "type": "AdaptiveCard",
  "version": "1.4",
  "body": [
    {
      "type": "TextBlock",
      "size": "medium",
      "weight": "bolder",
      "text": "AdaptiveRefreshSerializeBug",
      "wrap": true,
      "style": "heading"
    }
  ],
  "refresh": {
    "action": {
      "type": "Action.Execute",
      "verb": "refresh",
      "title": "Refresh"
    },
    "userIds": [
      "testUser"
    ]
  }
}

Actual Outcome

{
  "type": "AdaptiveCard",
  "version": "1.4",
  "body": [
    {
      "type": "TextBlock",
      "size": "medium",
      "weight": "bolder",
      "text": "AdaptiveRefreshSerializeBug",
      "wrap": true,
      "style": "heading"
    }
  ],
  "refresh": {
    "Action": {
      "type": "Action.Execute",
      "verb": "refresh",
      "title": "Refresh"
    },
    "UserIds": [
      "testUser"
    ]
  }
}

Card JSON

If the card JSON is adjusted to the Actual Outcome, rendering is correct.

Repro Steps

The following console application demonstrates the bug. Compare the output to the const:

using AdaptiveCards;
using System;

namespace AdaptiveRefreshSerializeBug
{
  class Program
  {
    public const string RefreshCard = @"
{
  ""$schema"": ""http://adaptivecards.io/schemas/adaptive-card.json"",
  ""type"": ""AdaptiveCard"",
  ""version"": ""1.4"",
  ""refresh"": {
    ""action"": {
      ""type"": ""Action.Execute"",
      ""title"": ""Refresh"",
      ""verb"": ""refresh""
    },
    ""userIds"": [""testUser""]
  },
  ""body"": [
    {
      ""type"": ""TextBlock"",
      ""size"": ""Medium"",
      ""weight"": ""Bolder"",
      ""text"": ""AdaptiveRefreshSerializeBug"",
      ""wrap"": true,
      ""style"": ""heading""
    }
  ]
}";


    static void Main(string[] args)
    {
      var card = AdaptiveCard.FromJson(RefreshCard);

      Console.WriteLine(card.Card.ToJson());
    }
  }
}
@ghost ghost added this to Not Triaged in Triage Jan 3, 2022
@ghost
Copy link

ghost commented Jan 3, 2022

Many of our core contributors are taking some much needed vacation time throughout December 2021. Thank you for being patient while we recharge and return to normal responsiveness in January 2022. In the meantime, please feel free to continue to pose questions, open issues, and make feature requests - you may not get a response right away, but we'll reply once we're back in January. Thanks!

@pschaeflein
Copy link
Author

Since you are looking at serialization, can I kindly ask you re-visit #4716?

@Greg-Hitchon
Copy link
Contributor

happy to see work on this! spent more time than I should have trying to figure out what was happening before I found the root cause and this issue.

Triage automation moved this from P2 to Closed Mar 10, 2022
paulcam206 pushed a commit that referenced this issue Mar 10, 2022
Co-authored-by: Cicero Silva Luiz Junior <cluizjunior@microsoft.com>
michaelfarnsworth pushed a commit to michaelfarnsworth/AdaptiveCards that referenced this issue Nov 10, 2022
)

Co-authored-by: Cicero Silva Luiz Junior <cluizjunior@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Triage
Closed
Development

Successfully merging a pull request may close this issue.

4 participants