-
-
Notifications
You must be signed in to change notification settings - Fork 746
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
Request payload corrupted when using System.Text.Json serializer #952
Comments
I'm seeing this issue as well now. Sending a request containing a byte array, and the receiving side waits for data it never receives. Reading a single byte at the time from the incoming stream, its within the base64 encoded byte[] array. |
We need a repro (failing test ideally) to figure out what's going on.... so far, all tests are passing and System.Text.Json is set to be the default in #1005 |
What does the object with the byte array / request look like so we can try to repro? |
Created a test project outside refit source, since I was not able to create a failing test within the existing refit tests framework. You probably know how.. :-) https://github.com/cocytus/RfTest -> This fails when the size of the array reaches 61400
|
I just got to test this using a locally compiled refit, by copying the refit stubs generator compile target from Refit.Tests.csproj. With the main branch checked out, the error does not occur. If i check out the commit tagged 5.2.1, it does occur. So it's fixed... whatever it was. |
As is visible from PR, it seems like it was not actually fixed, just not visible, but for some users it might very well be. |
Fixes issue #952 - did not write everything to output stream
Fixes issue #952 - did not write everything to output stream
This is fixed in version 5.2.4 (and 6.0-preview), just published to NuGet. Thank you @cocytus for the repro and patch! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Describe the bug
When a request is serialized using SystemTextJsonContentSerializer, the request payload looks incomplete.
Steps To Reproduce
Send a request to a service using a payload with byte array and some other attributes (sorry, I can't attach a reproducible sample).
!! Instead, using NewtonsoftJsonContentSerializer the problem is not reproducible and everything works like expected.
Expected behavior
I expect that my request is being serialized in the right way without any data loss.
Environment
The text was updated successfully, but these errors were encountered: