diff --git a/src/WireMock.Net.ProtoBuf/Util/ProtoBufUtils.cs b/src/WireMock.Net.ProtoBuf/Util/ProtoBufUtils.cs index 591ae5b4..5a8a5c1b 100644 --- a/src/WireMock.Net.ProtoBuf/Util/ProtoBufUtils.cs +++ b/src/WireMock.Net.ProtoBuf/Util/ProtoBufUtils.cs @@ -1,8 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using JsonConverter.Abstractions; using ProtoBufJsonConverter; using ProtoBufJsonConverter.Models; diff --git a/src/WireMock.Net.Shared/Settings/ProxyAndRecordSettings.cs b/src/WireMock.Net.Shared/Settings/ProxyAndRecordSettings.cs index 35536a70..7adc4e9d 100644 --- a/src/WireMock.Net.Shared/Settings/ProxyAndRecordSettings.cs +++ b/src/WireMock.Net.Shared/Settings/ProxyAndRecordSettings.cs @@ -82,11 +82,13 @@ public class ProxyAndRecordSettings : HttpClientSettings [PublicAPI] public ProxyUrlReplaceSettings? ReplaceSettings { get; set; } + /* /// /// Prefer the Proxy Mapping over the saved Mapping (in case SaveMapping is set to true). /// //[PublicAPI] //public bool PreferProxyMapping { get; set; } + */ /// /// When SaveMapping is set to true, this setting can be used to control the behavior of the generated request matchers for the new mapping. diff --git a/src/WireMock.Net.Shared/Settings/SimpleSettingsParser.cs b/src/WireMock.Net.Shared/Settings/SimpleSettingsParser.cs index 322d687f..5a0c149c 100644 --- a/src/WireMock.Net.Shared/Settings/SimpleSettingsParser.cs +++ b/src/WireMock.Net.Shared/Settings/SimpleSettingsParser.cs @@ -1,9 +1,6 @@ // Copyright © WireMock.Net -using System; using System.Collections; -using System.Collections.Generic; -using System.Linq; using WireMock.Extensions; using WireMock.Util; @@ -197,6 +194,6 @@ internal class SimpleSettingsParser public T? GetObjectValueFromJson(string name) { var value = GetValue(name, values => values.FirstOrDefault()); - return string.IsNullOrWhiteSpace(value) ? default : JsonUtils.DeserializeObject(value); + return string.IsNullOrWhiteSpace(value) ? default : JsonUtils.DeserializeObject(value!); } } diff --git a/src/WireMock.Net.Shared/Util/IProtoBufUtils.cs b/src/WireMock.Net.Shared/Util/IProtoBufUtils.cs index 7170d6dd..9e572a8f 100644 --- a/src/WireMock.Net.Shared/Util/IProtoBufUtils.cs +++ b/src/WireMock.Net.Shared/Util/IProtoBufUtils.cs @@ -1,8 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using JsonConverter.Abstractions; using WireMock.ResponseBuilders; @@ -13,7 +10,24 @@ namespace WireMock.Util; /// public interface IProtoBufUtils { + /// + /// Converts a JSON-like object to a ProtoBuf message including the length header. + /// + /// The Proto definition content used to resolve message types. + /// The fully qualified ProtoBuf message type name to serialize to. + /// The source object to convert. + /// Optional JSON converter used during serialization. + /// The cancellation token. + /// The serialized ProtoBuf payload with header, or an empty byte array when input is invalid. Task GetProtoBufMessageWithHeaderAsync(IReadOnlyList? protoDefinitions, string? messageType, object? value, IJsonConverter? jsonConverter = null, CancellationToken cancellationToken = default); + /// + /// Updates the response builder to return a ProtoBuf body using method-level or mapping-level proto definitions. + /// + /// The response builder to update. + /// The ProtoBuf message type for the response body. + /// The response body object represented as JSON-like data. + /// Optional Proto definitions for this call; when omitted, mapping/server-level definitions are used. + /// The updated response builder. IResponseBuilder UpdateResponseBuilder(IResponseBuilder responseBuilder, string protoBufMessageType, object bodyAsJson, params string[] protoDefinitions); } \ No newline at end of file