mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-20 15:31:20 +02:00
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:
@@ -10,4 +10,6 @@ internal struct TransformModel
|
||||
public IRequestMessage request { get; set; }
|
||||
|
||||
public IResponseMessage? response { get; set; }
|
||||
|
||||
public object data { get; set; }
|
||||
}
|
||||
@@ -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 { }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user