-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
Either memory stream or to serialize on the writer. This consolidates and funnels places that need to write bytes/streams/objects directly
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 left some comments.
src/Nest/CommonAbstractions/SerializationBehavior/JsonFormatters/SourceFormatter.cs
Outdated
Show resolved
Hide resolved
|
||
var bodyBytes = bodySerializer.SerializeToBytes(body, memoryStreamFactory, SerializationFormatting.None); | ||
writer.WriteRaw(bodyBytes); | ||
SourceWriter.Serialize(ref writer, body, formatterResolver); |
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.
This looks like a behavioural change?
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.
Because SerializationFormatting.None
is not specified explicitly?
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.
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
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.
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 |
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.
Does DiagnosticsSerializerProxy
still need to implement IInternalSerializerWithFormatter
?
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.
Remove it instead since its internal
Closing in favor of: #4313 Addressed remaining feedback there as well. |
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