From dcdea50ef31411ed9068513a81656fd5d5f51e46 Mon Sep 17 00:00:00 2001 From: jonnii Date: Mon, 20 Nov 2017 15:32:30 -0500 Subject: [PATCH] Virtual serialize methods --- src/SpeakEasy/Serializers/DefaultJsonSerializer.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SpeakEasy/Serializers/DefaultJsonSerializer.cs b/src/SpeakEasy/Serializers/DefaultJsonSerializer.cs index 65e8799..2041bff 100644 --- a/src/SpeakEasy/Serializers/DefaultJsonSerializer.cs +++ b/src/SpeakEasy/Serializers/DefaultJsonSerializer.cs @@ -32,7 +32,7 @@ public DefaultJsonSerializer(JsonSerializer serializer, int serializationBufferS this.serializationBufferSize = serializationBufferSize; } - public IEnumerable SupportedMediaTypes => new[] + public virtual IEnumerable SupportedMediaTypes => new[] { "application/json", "text/json", @@ -40,9 +40,9 @@ public DefaultJsonSerializer(JsonSerializer serializer, int serializationBufferS "text/javascript" }; - public string MediaType => SupportedMediaTypes.First(); + public virtual string MediaType => SupportedMediaTypes.First(); - public Task SerializeAsync(Stream stream, T body, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task SerializeAsync(Stream stream, T body, CancellationToken cancellationToken = default(CancellationToken)) { using (var streamWriter = new StreamWriter(stream, new System.Text.UTF8Encoding(false), serializationBufferSize, true)) { @@ -55,7 +55,7 @@ public DefaultJsonSerializer(JsonSerializer serializer, int serializationBufferS return okTask; } - public T Deserialize(Stream body) + public virtual T Deserialize(Stream body) { using (var streamReader = new StreamReader(body)) { @@ -66,7 +66,7 @@ public T Deserialize(Stream body) } } - public object Deserialize(Stream body, Type type) + public virtual object Deserialize(Stream body, Type type) { using (var streamReader = new StreamReader(body)) {