diff --git a/Request-Matching.md b/Request-Matching.md index bb625c3..7295274 100644 --- a/Request-Matching.md +++ b/Request-Matching.md @@ -570,4 +570,40 @@ server .RespondWith(Response.Create() .WithStatusCode(HttpStatusCode.Unauthorized) .WithBody(@"{ ""result"": ""api-key missing""}")); +``` + +A JSON Mapping example looks like: +``` json +{ + "Guid": "29971ff8-4adb-4ec7-8b7d-a2ce6e5ca630", + "Request": { + "Path": { + "Matchers": [ + { + "Name": "WildcardMatcher", + "Pattern": "/doesnot-need-a-key" + } + ] + }, + "Headers": [ + { + "Name": "api-key", + "Matchers": [ + { + "Name": "WildcardMatcher", + "Pattern": "*", + "IgnoreCase": true, + "RejectOnMatch": true + } + ] + } + ] + }, + "Response": { + "StatusCode": 401, + "BodyDestination": "SameAsSource", + "Body": "{ \"result\": \"api-key missing\"}", + "Headers": {} + } +} ``` \ No newline at end of file