Skip to content

Adds more write overloads to Utf8Json #4209

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

Closed
wants to merge 5 commits into from
Closed

Conversation

Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Nov 11, 2019

Either memory stream or to serialize on the writer.

This consolidates and funnels places that need to write bytes/streams/objects directly.

Isolated from #4172 and #4191 which both grew to be too big to review

Either memory stream or to serialize on the writer.

This consolidates and funnels places that need to write
bytes/streams/objects directly
Copy link
Contributor

@russcam russcam left a comment

Choose a reason for hiding this comment

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

I left some comments.


var bodyBytes = bodySerializer.SerializeToBytes(body, memoryStreamFactory, SerializationFormatting.None);
writer.WriteRaw(bodyBytes);
SourceWriter.Serialize(ref writer, body, formatterResolver);
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like a behavioural change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because SerializationFormatting.None is not specified explicitly?

Copy link
Contributor

Choose a reason for hiding this comment

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

The behavioural change looks like the SourceWriter is now always used.

Before, the requestResponseSerializer was used when the operation was an update or the body was an ILazyDocument

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh you are right, will address!

@@ -32,12 +32,16 @@ public SerializerRegistrationInformation(Type type, string purpose)
public override string ToString() => _stringRepresentation;
}

//TODO this no longer needs to be IInternalSerializerWithFormatter
Copy link
Contributor

Choose a reason for hiding this comment

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

Does DiagnosticsSerializerProxy still need to implement IInternalSerializerWithFormatter?

Copy link
Member Author

Choose a reason for hiding this comment

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

Remove it instead since its internal

@Mpdreamz
Copy link
Member Author

Mpdreamz commented Jan 9, 2020

Closing in favor of: #4313

Addressed remaining feedback there as well.

@Mpdreamz Mpdreamz closed this Jan 9, 2020
@Mpdreamz Mpdreamz deleted the fix/7.x/utf8-json-touchups branch January 9, 2020 21:43
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.

2 participants