Add Grpc ProtoBuf support (request-response) (#1047)

* ProtoBuf

* .

* x

* ---

* x

* fx

* ...

* sc

* ...

* .

* groen

* x

* fix tests

* ok!?

* fix tests

* fix tests

* !

* x

* 6

* .

* x

* ivaluematcher

* transformer

* .

* sc

* .

* mapping

* x

* tra

* com

* ...

* .

* .

* .

* AddProtoDefinition

* .

* set

* grpahj

* .

* .

* IdOrText

* ...

* async

* async2

* .

* t

* nuget

* <PackageReference Include="ProtoBufJsonConverter" Version="0.2.0-preview-04" />

* http version

* tests

* .WithHttpVersion("2")

* <PackageReference Include="ProtoBufJsonConverter" Version="0.2.0" />

* HttpVersionParser
This commit is contained in:
Stef Heyenrath
2024-02-16 17:16:51 +01:00
committed by GitHub
parent 801546fae7
commit 6ac95cf57d
129 changed files with 4585 additions and 1556 deletions

View File

@@ -4,7 +4,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using Newtonsoft.Json;
#if USE_ASPNETCORE
using System.Security.Cryptography.X509Certificates;
#endif
@@ -51,6 +50,9 @@ public class RequestMessage : IRequestMessage
/// <inheritdoc />
public string Method { get; }
/// <inheritdoc />
public string HttpVersion { get; }
/// <inheritdoc />
public IDictionary<string, WireMockList<string>>? Headers { get; }
@@ -73,14 +75,14 @@ public class RequestMessage : IRequestMessage
public string? Body { get; }
/// <inheritdoc />
public object? BodyAsJson { get; }
public object? BodyAsJson { get; set; }
/// <inheritdoc />
public byte[]? BodyAsBytes { get; }
#if MIMEKIT
/// <inheritdoc />
[JsonIgnore] // Issue 1001
[Newtonsoft.Json.JsonIgnore] // Issue 1001
public object? BodyAsMimeMessage { get; }
#endif
@@ -125,11 +127,13 @@ public class RequestMessage : IRequestMessage
internal RequestMessage(
IWireMockMiddlewareOptions? options,
UrlDetails urlDetails, string method,
UrlDetails urlDetails,
string method,
string clientIP,
IBodyData? bodyData = null,
IDictionary<string, string[]>? headers = null,
IDictionary<string, string>? cookies = null
IDictionary<string, string>? cookies = null,
string httpVersion = "1.1"
#if USE_ASPNETCORE
, X509Certificate2? clientCertificate = null
#endif
@@ -152,6 +156,7 @@ public class RequestMessage : IRequestMessage
AbsolutePathSegments = AbsolutePath.Split('/').Skip(1).ToArray();
Method = method;
HttpVersion = httpVersion;
ClientIP = clientIP;
BodyData = bodyData;