Add 'Data' to response which can be used during transforming the response (#893)

* Add 'Data' to response which can be used during transforming the response

* md

* hb

* fix

* Linq

* fix test

* v4

* 14

* .

* x

* remove

* s
This commit is contained in:
Stef Heyenrath
2023-03-09 17:20:34 +01:00
committed by GitHub
parent 36c9d95abb
commit 7426bf76ee
28 changed files with 543 additions and 268 deletions

View File

@@ -10,4 +10,6 @@ internal struct TransformModel
public IRequestMessage request { get; set; }
public IResponseMessage? response { get; set; }
public object data { get; set; }
}

View File

@@ -5,6 +5,7 @@ using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Stef.Validation;
using WireMock.ResponseBuilders;
using WireMock.Settings;
using WireMock.Types;
using WireMock.Util;
@@ -115,7 +116,8 @@ internal class Transformer : ITransformer
{
mapping = mapping,
request = request,
response = response
response = response,
data = mapping.Data ?? new { }
});
}