Skip to content

Conversation

eiriktsarpalis
Copy link
Member

Has been largely fixed thanks to the infrastructural changes in #70435 and #72789. This adds a fix for the case of dictionary converters that was missed out and includes a regression test for the original bug report.

Fix #46522.

@eiriktsarpalis eiriktsarpalis requested a review from krwq August 2, 2022 18:58
@ghost ghost added the area-System.Text.Json label Aug 2, 2022
@ghost ghost assigned eiriktsarpalis Aug 2, 2022
@eiriktsarpalis eiriktsarpalis requested a review from layomia August 2, 2022 18:58
@eiriktsarpalis eiriktsarpalis added this to the 7.0.0 milestone Aug 2, 2022
@ghost
Copy link

ghost commented Aug 2, 2022

Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis
See info in area-owners.md if you want to be subscribed.

Issue Details

Has been largely fixed thanks to the infrastructural changes in #70435 and #72789. This adds a fix for the case of dictionary converters that was missed out and includes a regression test for the original bug report.

Fix #46522.

Author: eiriktsarpalis
Assignees: -
Labels:

area-System.Text.Json

Milestone: -

@eiriktsarpalis
Copy link
Member Author

I've expanded the scope of this PR somewhat, incorporating equivalent fixes & testing for the serialization case. The PR also includes a few additional changes, tidying up logic around the casting converter and ensuring we never layer multiple casting converters on top of each other.

@eiriktsarpalis eiriktsarpalis merged commit 247bcdc into dotnet:main Aug 4, 2022
@eiriktsarpalis eiriktsarpalis deleted the fix-converter-invalidcastexception branch August 4, 2022 21:24
@ghost ghost locked as resolved and limited conversation to collaborators Sep 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JsonSerializer throw an InvalidCastException when serializing an array of item with a custom converter
3 participants