Skip to content

Commit

Permalink
Columns are optional in ColumnSet, we had made then required. (#2001)
Browse files Browse the repository at this point in the history
Addresses issue #1998
  • Loading branch information
Gilles Khouzam committed Oct 8, 2018
1 parent 9a8ed09 commit db789c8
Show file tree
Hide file tree
Showing 18 changed files with 39 additions and 1 deletion.
15 changes: 15 additions & 0 deletions samples/Tests/ColumnSet.Empty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "This empty columnset should not prevent the card from rendering"
},
{
"type": "ColumnSet",
"columns": []
}
]
}
2 changes: 1 addition & 1 deletion source/shared/cpp/ObjectModel/ColumnSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ std::shared_ptr<BaseCardElement> ColumnSetParser::Deserialize(
auto container = BaseCardElement::Deserialize<ColumnSet>(value);

// Parse Columns
auto cardElements = ParseUtil::GetElementCollectionOfSingleType<Column>(elementParserRegistration, actionParserRegistration, warnings, value, AdaptiveCardSchemaKey::Columns, Column::Deserialize, true);
auto cardElements = ParseUtil::GetElementCollectionOfSingleType<Column>(elementParserRegistration, actionParserRegistration, warnings, value, AdaptiveCardSchemaKey::Columns, Column::Deserialize, false);
container->m_columns = std::move(cardElements);

// Parse optional selectAction
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "This empty columnset should not prevent the card from rendering"
},
{
"type": "ColumnSet",
"columns": []
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"actions":[],"body":[{"text":"This empty columnset should not prevent the card from rendering","type":"TextBlock"},{"columns":[],"type":"ColumnSet"}],"type":"AdaptiveCard","version":"1.0"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"HostConfigHash":"febd141","CardHash":"461f2d5","Error":null}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"HostConfigHash":"04138f4","CardHash":"461f2d5","Error":null}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"HostConfigHash":"45c4c50","CardHash":"461f2d5","Error":null}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"HostConfigHash":"3e47fb4","CardHash":"461f2d5","Error":null}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"HostConfigHash":"2ac7c52","CardHash":"461f2d5","Error":null}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"HostConfigHash":"e188ab9","CardHash":"461f2d5","Error":null}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"HostConfigHash":"e3927b5","CardHash":"461f2d5","Error":null}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit db789c8

Please sign in to comment.