This repository was archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Added failing test case for issue #37610 - [System.Text.Json] Serializing class that has array of children of the same class throws StackOverflowException #37611
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
56af2d2
Added failing test for #37610 - [System.Text.Json] Serializing class …
oskardudycz 7df1c92
Updated naming
oskardudycz c1e7d5d
Added ActiveIssue attribute to CyclicTests.WriteTestClassWithArrayOfE…
oskardudycz 64e1b27
Fixed formatting of CyclicTests
oskardudycz 10353ab
Updated assert in CyclicTests.WriteTestClassWithArrayOfElementsOfTheS…
oskardudycz 6aaacc2
Merge branch 'master' of github.com:oskardudycz/corefx
oskardudycz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pranavkm, @rynowak - what do you expect the behavior to be here? Is returning an empty object JSON fine or should the serializer throw
ArgumentException/InvalidOperationException?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty object for certain. This is a legal and useful way to define a data-type 👍
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any value in the output being something like the following instead of
{}(if it was feasible)?{"Array":[]}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should be empty object or empty object with inner array initialized with
undefinedvalue. For sure it shouldn't be empty array, as property was not initialized.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tried, but does this reproduce with a
Dictionaryproperty:Might be useful to also capture this as a test scenario to make sure this works too.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it's happening for all collections. My initial issue was for arrays (https://github.com/dotnet/corefx/issues/37610) while it's duplicate of the issue with lists (https://github.com/dotnet/corefx/issues/37313)