Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detect collisions and generate parse errors when they are encountered (…
…#2171) Fix for #1852. * source/shared/** * Introduce new `ParseContext.cpp` and `ParseContext.h` * `ParseContext` encapsulates objects that need to be passed around at parse time * Add new `std::unordered_set<std::string>` to track ids * (previously: `ElementParserRegistration`, `ActionParserRegistration`, and `std::vector<AdaptiveParseWarning>`) * Various wiring to replace passing the old context items with `ParseContext` * New unit tests for single and nested duplicate id scenarios * Fixes to refrain from marking default dtors as virtual (cppcore) * Some `#include` cleanup * Reorder STL includes in `pch.h` for sanity's sake * source/uwp/** * Update expected results for new failing tests * Add new files to shared model projection * Updates for new `Deserialize` signature * samples/tests * tests for duplicate ids in single and nested scenarios * source/android/** * Fixes to consume new header/object * SWIG'd changes * source/dotnet/Library/adaptivecards/** * Introduce new `HashSet<string>` to track element ids * Add id tracking during [de]serialization (throw on collision) * Introduce a way to indicate when a card begins/ends parsing (needed to reset our id tracking member) * Account for expected failures for new tests * source/ios/** * Publish/consume new cpp/h
- Loading branch information
1 parent
a312324
commit 97d01cf
Showing
126 changed files
with
2,016 additions
and
2,203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json", | ||
"type": "AdaptiveCard", | ||
"version": "1.0", | ||
"body": [ | ||
{ | ||
"type": "TextBlock", | ||
"text": "This card as duplicate ids and shouldn't render!" | ||
}, | ||
{ | ||
"type": "Input.Text", | ||
"id": "duplicate", | ||
"placeholder": "uh-oh" | ||
}, | ||
{ | ||
"type": "Input.Text", | ||
"id": "duplicate", | ||
"placeholder": "not again!" | ||
} | ||
], | ||
"actions": [ | ||
{ | ||
"type": "Action.Submit", | ||
"title": "Action.Submit" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json", | ||
"type": "AdaptiveCard", | ||
"version": "1.0", | ||
"body": [ | ||
{ | ||
"type": "Input.Text", | ||
"placeholder": "Name", | ||
"style": "text", | ||
"maxLength": 0, | ||
"id": "duplicate" | ||
} | ||
], | ||
"actions": [ | ||
{ | ||
"type": "Action.Submit", | ||
"title": "Submit", | ||
"data": { | ||
"id": "1234567890" | ||
} | ||
}, | ||
{ | ||
"type": "Action.ShowCard", | ||
"title": "Show Card", | ||
"card": { | ||
"type": "AdaptiveCard", | ||
"body": [ | ||
{ | ||
"type": "Input.Text", | ||
"placeholder": "enter comment", | ||
"style": "text", | ||
"maxLength": 0, | ||
"id": "duplicate" | ||
} | ||
], | ||
"actions": [ | ||
{ | ||
"type": "Action.Submit", | ||
"title": "OK" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2,084 changes: 909 additions & 1,175 deletions
2,084
source/android/adaptivecards/src/main/cpp/objectmodel_wrap.cpp
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.