Skip to content

Commit

Permalink
Merge pull request #919 from AArnott/removeAddedAPIs
Browse files Browse the repository at this point in the history
Remove properties inadvertently made public
  • Loading branch information
AArnott authored May 16, 2023
2 parents 3d86350 + 1452083 commit 5c5f52e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
26 changes: 16 additions & 10 deletions src/StreamJsonRpc/FormatterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ public abstract class FormatterBase : IJsonRpcFormatterState, IJsonRpcInstanceCo
/// </summary>
private MessageFormatterRpcMarshaledContextTracker? rpcMarshaledContextTracker;

private RequestId serializingMessageWithId;

private RequestId deserializingMessageWithId;

private bool serializingRequest;

/// <summary>
/// Initializes a new instance of the <see cref="FormatterBase"/> class.
/// </summary>
Expand All @@ -64,13 +70,13 @@ protected interface IMessageWithTopLevelPropertyBag
}

/// <inheritdoc />
public RequestId SerializingMessageWithId { get; private set; }
RequestId IJsonRpcFormatterState.SerializingMessageWithId => this.serializingMessageWithId;

/// <inheritdoc />
public RequestId DeserializingMessageWithId { get; private set; }
RequestId IJsonRpcFormatterState.DeserializingMessageWithId => this.deserializingMessageWithId;

/// <inheritdoc />
public bool SerializingRequest { get; private set; }
bool IJsonRpcFormatterState.SerializingRequest => this.serializingRequest;

/// <inheritdoc/>
JsonRpc IJsonRpcInstanceContainer.Rpc
Expand Down Expand Up @@ -254,10 +260,10 @@ public DeserializationTracking(FormatterBase formatter, JsonRpcMessage message,

// Deserialization of messages should never occur concurrently for a single instance of a formatter.
// But we may be nested in another, in which case, this should do nothing.
if (formatter.DeserializingMessageWithId.IsEmpty)
if (formatter.deserializingMessageWithId.IsEmpty)
{
formatter.DeserializingMessage = message;
formatter.DeserializingMessageWithId = (message as IJsonRpcMessageWithId)?.RequestId ?? default;
formatter.deserializingMessageWithId = (message as IJsonRpcMessageWithId)?.RequestId ?? default;

// Consider the attribute applied to the particular overload that we're considering right now.
formatter.ApplicableMethodAttributeOnDeserializingMethod = message is JsonRpcRequest { Method: not null } request ? formatter.JsonRpc?.GetJsonRpcMethodAttribute(request.Method, parameters) : null;
Expand All @@ -273,7 +279,7 @@ public void Dispose()
{
if (this.formatter is not null)
{
this.formatter.DeserializingMessageWithId = default;
this.formatter.deserializingMessageWithId = default;
this.formatter.DeserializingMessage = null;
this.formatter.ApplicableMethodAttributeOnDeserializingMethod = null;
}
Expand All @@ -297,17 +303,17 @@ public SerializationTracking(FormatterBase formatter, JsonRpcMessage message)
Requires.NotNull(formatter);

this.formatter = formatter;
this.formatter.SerializingMessageWithId = (message as IJsonRpcMessageWithId)?.RequestId ?? default;
this.formatter.SerializingRequest = message is JsonRpcRequest;
this.formatter.serializingMessageWithId = (message as IJsonRpcMessageWithId)?.RequestId ?? default;
this.formatter.serializingRequest = message is JsonRpcRequest;
}

/// <summary>
/// Clears serialization state.
/// </summary>
public void Dispose()
{
this.formatter.SerializingMessageWithId = default;
this.formatter.SerializingRequest = false;
this.formatter.serializingMessageWithId = default;
this.formatter.serializingRequest = false;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/StreamJsonRpc/SystemTextJsonFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace StreamJsonRpc;
/// <summary>
/// A formatter that emits UTF-8 encoded JSON where user data should be serializable via the <see cref="JsonSerializer"/>.
/// </summary>
public class SystemTextJsonFormatter : FormatterBase, IJsonRpcMessageFormatter, IJsonRpcMessageTextFormatter, IJsonRpcInstanceContainer, IJsonRpcFormatterState, IJsonRpcMessageFactory, IJsonRpcFormatterTracingCallbacks
public class SystemTextJsonFormatter : FormatterBase, IJsonRpcMessageFormatter, IJsonRpcMessageTextFormatter, IJsonRpcInstanceContainer, IJsonRpcMessageFactory, IJsonRpcFormatterTracingCallbacks
{
private static readonly JsonWriterOptions WriterOptions = new() { };

Expand Down
3 changes: 0 additions & 3 deletions src/StreamJsonRpc/netstandard2.0/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ StreamJsonRpc.FormatterBase.DeserializationTracking
StreamJsonRpc.FormatterBase.DeserializationTracking.DeserializationTracking() -> void
StreamJsonRpc.FormatterBase.DeserializationTracking.DeserializationTracking(StreamJsonRpc.FormatterBase! formatter, StreamJsonRpc.Protocol.JsonRpcMessage! message, System.ReadOnlySpan<System.Reflection.ParameterInfo!> parameters) -> void
StreamJsonRpc.FormatterBase.DeserializationTracking.Dispose() -> void
StreamJsonRpc.FormatterBase.DeserializingMessageWithId.get -> StreamJsonRpc.RequestId
StreamJsonRpc.FormatterBase.Dispose() -> void
StreamJsonRpc.FormatterBase.DuplexPipeTracker.get -> StreamJsonRpc.Reflection.MessageFormatterDuplexPipeTracker!
StreamJsonRpc.FormatterBase.EnumerableTracker.get -> StreamJsonRpc.Reflection.MessageFormatterEnumerableTracker!
Expand Down Expand Up @@ -44,8 +43,6 @@ StreamJsonRpc.FormatterBase.SerializationTracking
StreamJsonRpc.FormatterBase.SerializationTracking.Dispose() -> void
StreamJsonRpc.FormatterBase.SerializationTracking.SerializationTracking() -> void
StreamJsonRpc.FormatterBase.SerializationTracking.SerializationTracking(StreamJsonRpc.FormatterBase! formatter, StreamJsonRpc.Protocol.JsonRpcMessage! message) -> void
StreamJsonRpc.FormatterBase.SerializingMessageWithId.get -> StreamJsonRpc.RequestId
StreamJsonRpc.FormatterBase.SerializingRequest.get -> bool
StreamJsonRpc.FormatterBase.TopLevelPropertyBagBase
StreamJsonRpc.FormatterBase.TopLevelPropertyBagBase.OutboundProperties.get -> System.Collections.Generic.Dictionary<string!, (System.Type! DeclaredType, object? Value)>!
StreamJsonRpc.FormatterBase.TopLevelPropertyBagBase.TopLevelPropertyBagBase(bool isOutbound) -> void
Expand Down
3 changes: 0 additions & 3 deletions src/StreamJsonRpc/netstandard2.1/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ StreamJsonRpc.FormatterBase.DeserializationTracking
StreamJsonRpc.FormatterBase.DeserializationTracking.DeserializationTracking() -> void
StreamJsonRpc.FormatterBase.DeserializationTracking.DeserializationTracking(StreamJsonRpc.FormatterBase! formatter, StreamJsonRpc.Protocol.JsonRpcMessage! message, System.ReadOnlySpan<System.Reflection.ParameterInfo!> parameters) -> void
StreamJsonRpc.FormatterBase.DeserializationTracking.Dispose() -> void
StreamJsonRpc.FormatterBase.DeserializingMessageWithId.get -> StreamJsonRpc.RequestId
StreamJsonRpc.FormatterBase.Dispose() -> void
StreamJsonRpc.FormatterBase.DuplexPipeTracker.get -> StreamJsonRpc.Reflection.MessageFormatterDuplexPipeTracker!
StreamJsonRpc.FormatterBase.EnumerableTracker.get -> StreamJsonRpc.Reflection.MessageFormatterEnumerableTracker!
Expand Down Expand Up @@ -44,8 +43,6 @@ StreamJsonRpc.FormatterBase.SerializationTracking
StreamJsonRpc.FormatterBase.SerializationTracking.Dispose() -> void
StreamJsonRpc.FormatterBase.SerializationTracking.SerializationTracking() -> void
StreamJsonRpc.FormatterBase.SerializationTracking.SerializationTracking(StreamJsonRpc.FormatterBase! formatter, StreamJsonRpc.Protocol.JsonRpcMessage! message) -> void
StreamJsonRpc.FormatterBase.SerializingMessageWithId.get -> StreamJsonRpc.RequestId
StreamJsonRpc.FormatterBase.SerializingRequest.get -> bool
StreamJsonRpc.FormatterBase.TopLevelPropertyBagBase
StreamJsonRpc.FormatterBase.TopLevelPropertyBagBase.OutboundProperties.get -> System.Collections.Generic.Dictionary<string!, (System.Type! DeclaredType, object? Value)>!
StreamJsonRpc.FormatterBase.TopLevelPropertyBagBase.TopLevelPropertyBagBase(bool isOutbound) -> void
Expand Down

0 comments on commit 5c5f52e

Please sign in to comment.