mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-05-28 10:49:14 +02:00
fix some warnings
This commit is contained in:
@@ -1,8 +1,5 @@
|
|||||||
// Copyright © WireMock.Net
|
// Copyright © WireMock.Net
|
||||||
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using JsonConverter.Abstractions;
|
using JsonConverter.Abstractions;
|
||||||
using ProtoBufJsonConverter;
|
using ProtoBufJsonConverter;
|
||||||
using ProtoBufJsonConverter.Models;
|
using ProtoBufJsonConverter.Models;
|
||||||
|
|||||||
@@ -82,11 +82,13 @@ public class ProxyAndRecordSettings : HttpClientSettings
|
|||||||
[PublicAPI]
|
[PublicAPI]
|
||||||
public ProxyUrlReplaceSettings? ReplaceSettings { get; set; }
|
public ProxyUrlReplaceSettings? ReplaceSettings { get; set; }
|
||||||
|
|
||||||
|
/*
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Prefer the Proxy Mapping over the saved Mapping (in case SaveMapping is set to <c>true</c>).
|
/// Prefer the Proxy Mapping over the saved Mapping (in case SaveMapping is set to <c>true</c>).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
//[PublicAPI]
|
//[PublicAPI]
|
||||||
//public bool PreferProxyMapping { get; set; }
|
//public bool PreferProxyMapping { get; set; }
|
||||||
|
*/
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// When SaveMapping is set to <c>true</c>, this setting can be used to control the behavior of the generated request matchers for the new mapping.
|
/// When SaveMapping is set to <c>true</c>, this setting can be used to control the behavior of the generated request matchers for the new mapping.
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
// Copyright © WireMock.Net
|
// Copyright © WireMock.Net
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using WireMock.Extensions;
|
using WireMock.Extensions;
|
||||||
using WireMock.Util;
|
using WireMock.Util;
|
||||||
|
|
||||||
@@ -197,6 +194,6 @@ internal class SimpleSettingsParser
|
|||||||
public T? GetObjectValueFromJson<T>(string name)
|
public T? GetObjectValueFromJson<T>(string name)
|
||||||
{
|
{
|
||||||
var value = GetValue(name, values => values.FirstOrDefault());
|
var value = GetValue(name, values => values.FirstOrDefault());
|
||||||
return string.IsNullOrWhiteSpace(value) ? default : JsonUtils.DeserializeObject<T>(value);
|
return string.IsNullOrWhiteSpace(value) ? default : JsonUtils.DeserializeObject<T>(value!);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
// Copyright © WireMock.Net
|
// Copyright © WireMock.Net
|
||||||
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using JsonConverter.Abstractions;
|
using JsonConverter.Abstractions;
|
||||||
using WireMock.ResponseBuilders;
|
using WireMock.ResponseBuilders;
|
||||||
|
|
||||||
@@ -13,7 +10,24 @@ namespace WireMock.Util;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IProtoBufUtils
|
public interface IProtoBufUtils
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Converts a JSON-like object to a ProtoBuf message including the length header.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="protoDefinitions">The Proto definition content used to resolve message types.</param>
|
||||||
|
/// <param name="messageType">The fully qualified ProtoBuf message type name to serialize to.</param>
|
||||||
|
/// <param name="value">The source object to convert.</param>
|
||||||
|
/// <param name="jsonConverter">Optional JSON converter used during serialization.</param>
|
||||||
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
|
/// <returns>The serialized ProtoBuf payload with header, or an empty byte array when input is invalid.</returns>
|
||||||
Task<byte[]> GetProtoBufMessageWithHeaderAsync(IReadOnlyList<string>? protoDefinitions, string? messageType, object? value, IJsonConverter? jsonConverter = null, CancellationToken cancellationToken = default);
|
Task<byte[]> GetProtoBufMessageWithHeaderAsync(IReadOnlyList<string>? protoDefinitions, string? messageType, object? value, IJsonConverter? jsonConverter = null, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates the response builder to return a ProtoBuf body using method-level or mapping-level proto definitions.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="responseBuilder">The response builder to update.</param>
|
||||||
|
/// <param name="protoBufMessageType">The ProtoBuf message type for the response body.</param>
|
||||||
|
/// <param name="bodyAsJson">The response body object represented as JSON-like data.</param>
|
||||||
|
/// <param name="protoDefinitions">Optional Proto definitions for this call; when omitted, mapping/server-level definitions are used.</param>
|
||||||
|
/// <returns>The updated response builder.</returns>
|
||||||
IResponseBuilder UpdateResponseBuilder(IResponseBuilder responseBuilder, string protoBufMessageType, object bodyAsJson, params string[] protoDefinitions);
|
IResponseBuilder UpdateResponseBuilder(IResponseBuilder responseBuilder, string protoBufMessageType, object bodyAsJson, params string[] protoDefinitions);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user