Closed darrenparkinson closed 4 years ago
@dclaux could you please take a look at this? Thanks
Hi @darrenparkinson. We have acknowledged this issue report. Please continue to follow this issue for updates/progress/questions.
@darrenparkinson all AC SDKs always serialize to the latest supported schema version. Now that we have shipped support for AC schema 1.3, toJSON will always generate a card with its version set to 1.3 by default, that is by design. But since v2.0 of the JS SDK, you can now explicitly specify which version of the schema you want to serialize to, which is what you have to do here:
card.toJSON(new SerializationContext(Versions.v1_2));
:tada:AdaptiveCards@2020.08
has been released which fixes this issue.:tada:
Handy links:
Platform
Author or host
Author. Sending cards to Webex Teams, but the issue is before it gets there.
Version of SDK
Issue is between version 2.0.0 and 2.1.0 of the JavaScript sdk loaded from npm.
Details
I have some code using 2.0.0 (below) which provides output as expected from
toJSON()
. When 2.1.0 is used,toJSON()
sends the latest version. This is alluded to in the release notes but I am specifying a version which is not being honoured.The following code is from the documentation:
Version 2.0.0 renders the following:
Version 2.1.0 renders the following:
Version 1.3 is not supported on the host and so is failing.