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

Users/clintwar/handletypeinfo #5960

Merged
merged 9 commits into from
Jul 13, 2021

Conversation

clintwar
Copy link
Contributor

@clintwar clintwar commented Jun 2, 2021

fixes #2148

Description

If $type information is included in serialized content the reader will be at start of an object. Instead of loading into JArray load into JToken and test to see if it is JObject. If it is set token to $values token. if there isn't one it will handle correctly and leave for instances when it is null.

How Verified

Added new test Test_TypeHandling
Since $type is included and AdditionalProperties is decorated with JsonExtensionData it gets stored there. Test removes this form expected elements and compares to ensure that the structure of the card is the same.

Microsoft Reviewers: Open in CodeFlow

@ghost ghost added the no-recent-activity label Jun 12, 2021
@ghost
Copy link

ghost commented Jun 12, 2021

Hi @clintwar. This non-spec pull request has had no recent activity for the past 5 days . Please take the necessary actions (review, address feedback or commit if reviewed already) to move this along.

@clintwar clintwar closed this Jun 14, 2021
@ghost ghost removed the no-recent-activity label Jun 14, 2021
@ghost
Copy link

ghost commented Jun 14, 2021

Hi @clintwar; Thanks for taking action on your previously stale pull request. Resetting staleness.

@clintwar clintwar reopened this Jun 14, 2021
@clintwar
Copy link
Contributor Author

clintwar commented Jun 14, 2021

The checks seems to keep failing on the Android-CI check. Is there anything that can be done to correct this? @paulcam206 is there something that needs to be done to be sure that all the checks complete?

@ghost ghost added the no-recent-activity label Jun 21, 2021
@ghost
Copy link

ghost commented Jun 21, 2021

Hi @clintwar. This non-spec pull request has had no recent activity for the past 5 days . Please take the necessary actions (review, address feedback or commit if reviewed already) to move this along.

@ghost ghost removed the no-recent-activity label Jun 21, 2021
@ghost
Copy link

ghost commented Jun 21, 2021

Hi @clintwar; Thanks for taking action on your previously stale pull request. Resetting staleness.

@ghost ghost added the no-recent-activity label Jun 26, 2021
@ghost
Copy link

ghost commented Jun 26, 2021

Hi @clintwar. This non-spec pull request has had no recent activity for the past 5 days . Please take the necessary actions (review, address feedback or commit if reviewed already) to move this along.

@jonmill
Copy link
Contributor

jonmill commented Jun 30, 2021

@RebeccaAnne - can you take a quick look and see if this looks good to you too? I think this PR hit our Android CI issue 2 weeks ago. if it can be merged, the Android CI should be unblocked

@ghost ghost removed the no-recent-activity label Jun 30, 2021
@ghost
Copy link

ghost commented Jun 30, 2021

Hi @jonmill; Thanks for commenting on this previously stale pull request. Resetting staleness. @clintwar FYI.

@ghost ghost added the no-recent-activity label Jul 6, 2021
@ghost
Copy link

ghost commented Jul 6, 2021

Hi @clintwar. This non-spec pull request has had no recent activity for the past 5 days . Please take the necessary actions (review, address feedback or commit if reviewed already) to move this along.

@ghost ghost removed the no-recent-activity label Jul 7, 2021
@ghost
Copy link

ghost commented Jul 7, 2021

Hi @clintwar; Thanks for taking action on your previously stale pull request. Resetting staleness.

@ghost ghost added the no-recent-activity label Jul 12, 2021
@ghost
Copy link

ghost commented Jul 12, 2021

Hi @clintwar. This non-spec pull request has had no recent activity for the past 5 days . Please take the necessary actions (review, address feedback or commit if reviewed already) to move this along.

@ghost ghost removed the no-recent-activity label Jul 13, 2021
@ghost
Copy link

ghost commented Jul 13, 2021

Hi @clintwar; Thanks for taking action on your previously stale pull request. Resetting staleness.

@clintwar
Copy link
Contributor Author

@jonmill and @RebeccaAnne It seems that the checks continue to fail and that is what is holding up merging of this PR. Looks like now it is IOS instead of Android.

@golddove
Copy link
Member

@clintwar checks are all passed!

@jonmill
Copy link
Contributor

jonmill commented Jul 13, 2021

@golddove - Thank you! Can you also give this a final review so we have 2 folks with eyes on it?

// now bring it back
AdaptiveCard card2 = cardObject.ToObject<AdaptiveCard>();

// card2 will now have AdditionalProperties because $type is not known and it seems $type is not ignored by Newtonsoft JsonExtensionData
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clintwar should this be considered a bug we should look into?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@golddove not sure I would call it a bug, since AdaptiveTypeElement has AdditionalProperties with JsonExtensionData attribute anything not defined gets thrown into it. $type is included by Newtonsoft when you serialize but I do not see any good means to ignore since there is not a good way to differentiate things included by the serialization vs things introduced in the json directly.

@golddove golddove merged commit 1ba5635 into microsoft:main Jul 13, 2021
paulcam206 pushed a commit that referenced this pull request Aug 19, 2021
* Fixing issue 2148

* Adding test to validate type handling

Co-authored-by: Clint Warriner <clintwa@microsoft.com>
Co-authored-by: Paul Campbell <paulcam@microsoft.com>
(cherry picked from commit 1ba5635)
jonmill pushed a commit that referenced this pull request Aug 25, 2021
* Fixing issue 2148

* Adding test to validate type handling

Co-authored-by: Clint Warriner <clintwa@microsoft.com>
Co-authored-by: Paul Campbell <paulcam@microsoft.com>
(cherry picked from commit 1ba5635)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bot Builder v4 IgnoreEmptyItemsConverter causes an issue when ReadJson
4 participants