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

Remove hardcoded limit in deserialization constructor arguments #75982

Merged

Conversation

eiriktsarpalis
Copy link
Member

See #71984 (comment) for an explanation on why this limit is not needed.

Fix #71984.

@eiriktsarpalis eiriktsarpalis self-assigned this Sep 21, 2022
@eiriktsarpalis eiriktsarpalis requested review from layomia, krwq and steveharter and removed request for layomia September 21, 2022 18:04
@eiriktsarpalis eiriktsarpalis added this to the 8.0.0 milestone Sep 21, 2022
@ghost
Copy link

ghost commented Sep 21, 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

See #71984 (comment) for an explanation on why this limit is not needed.

Fix #71984.

Author: eiriktsarpalis
Assignees: eiriktsarpalis
Labels:

area-System.Text.Json

Milestone: -

@@ -155,7 +156,7 @@ async Task RunTestAsync<T>()
DefaultBufferSize = 1
};

await Assert.ThrowsAsync<NotSupportedException>(async () => await StreamingSerializer.DeserializeWrapper<T>(stream, options));
value = await StreamingSerializer.DeserializeWrapper<T>(stream, options);
Copy link
Member

@krwq krwq Sep 23, 2022

Choose a reason for hiding this comment

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

should you add at least some tiny sanitization for couple of properties of value that they look good? (same above)

Copy link
Member Author

Choose a reason for hiding this comment

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

The problem is that the test method is generic on the deserialized type, so you can't really check anything other than validate that the JSON is nontrivial. I'm validating that roundtripping works as expected in the new test.

Copy link
Member

@krwq krwq left a comment

Choose a reason for hiding this comment

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

LGTM thanks for cleaning this up

@eiriktsarpalis eiriktsarpalis force-pushed the remove-constructor-argument-limit branch from 6ba26ad to 85d39d4 Compare September 26, 2022 13:41
@eiriktsarpalis eiriktsarpalis merged commit 3f0106a into dotnet:main Sep 26, 2022
@eiriktsarpalis eiriktsarpalis deleted the remove-constructor-argument-limit branch September 26, 2022 16:08
@BenjaminBrienen
Copy link

What's the release cycle for this kind of change? I'm curious when I can leverage this change in my code.

@eiriktsarpalis
Copy link
Member Author

What's the release cycle for this kind of change?

This should be released as part of .NET 8.

@BenjaminBrienen
Copy link

Holy crap that's.... quite a ways away......

@eiriktsarpalis
Copy link
Member Author

.NET 8 Preview 1 is going to be released early next year. If this is a blocking issue, you might consider referencing the .NET 8 prerelease NuGet package as soon as it becomes available.

@BenjaminBrienen
Copy link

I appreciate your help!

@eiriktsarpalis
Copy link
Member Author

And if you're feeling adventurous, you might want to try out our daily builds:

https://github.com/dotnet/runtime/blob/main/docs/project/dogfooding.md#obtaining-daily-builds-of-nuget-packages

Given that this was just merged, it should take a day or two before the fix becomes available.

@BenjaminBrienen
Copy link

Unfortunately, given the fact that I'm a new hire at my company and we're using .NET 5 sigh, I don't think they'd jump at the idea of using a nightly build in our production backend. Personally, I'd love to use the latest build possible, because that's where I learn the most. When I used to use .NET for personal projects, it was only as far as Unity (game engine) supported 😩 These days I'm using rust for personal projects. However, I really do appreciate the option to do this, and I thank you for your time to implement this fix.

@ikill69
Copy link

ikill69 commented Sep 26, 2022

@eiriktsarpalis Thanks for getting this resolved. I will watch out for the Preview and the release next year.

@ghost ghost locked as resolved and limited conversation to collaborators Oct 27, 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.

System.Text.Json can't deserialize type with more than 64 ctor parameters.
8 participants