Wiki Typo #223

Closed
opened 2025-12-29 14:25:37 +01:00 by adam · 3 comments
Owner

Originally created by @Solaflex on GitHub (Oct 30, 2019).

Hi,

Small issue in your Wiki doku regarding JsonMatcher, C# option 2:
https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#c-option-2

There is a new missing in the constructor call. Correctly it should be:

var server = FluentMockServer.Start();

server
    .Given(Request
    .Create()
    .WithPath("/jsonmatcher2")
    .WithBody(new JsonMatcher(new { x = 42, s = "s" }))
    .UsingPost())
    .WithGuid("debaf408-3b23-4c04-9d18-ef1c020e79f2")
    .RespondWith(Response.Create().WithBody(@"{ ""result"": ""jsonbodytest2"" }"));
Originally created by @Solaflex on GitHub (Oct 30, 2019). Hi, Small issue in your Wiki doku regarding JsonMatcher, C# option 2: https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#c-option-2 There is a `new` missing in the constructor call. Correctly it should be: ``` var server = FluentMockServer.Start(); server .Given(Request .Create() .WithPath("/jsonmatcher2") .WithBody(new JsonMatcher(new { x = 42, s = "s" })) .UsingPost()) .WithGuid("debaf408-3b23-4c04-9d18-ef1c020e79f2") .RespondWith(Response.Create().WithBody(@"{ ""result"": ""jsonbodytest2"" }")); ```
adam added the questiondoc labels 2025-12-29 14:25:37 +01:00
adam closed this issue 2025-12-29 14:25:38 +01:00
Author
Owner

@StefH commented on GitHub (Oct 30, 2019):

The start is a public static method, which will create a new instance. No need for new.

@StefH commented on GitHub (Oct 30, 2019): The start is a public static method, which will create a new instance. No need for new.
Author
Owner

@Solaflex commented on GitHub (Oct 30, 2019):

The typo is in the .WithBody call:

Your wiki:
.WithBody(new JsonMatcher({ x = 42, s = "s" }))

Above line throws a syntax error. It should be:
.WithBody(new JsonMatcher(new { x = 42, s = "s" }))

2019-10-30 11_23_54-SpotMoney CoreBackend - Microsoft Visual Studio

@Solaflex commented on GitHub (Oct 30, 2019): The typo is in the `.WithBody` call: Your wiki: `.WithBody(new JsonMatcher({ x = 42, s = "s" }))` Above line throws a syntax error. It should be: `.WithBody(new JsonMatcher(new { x = 42, s = "s" }))` ![2019-10-30 11_23_54-SpotMoney CoreBackend - Microsoft Visual Studio](https://user-images.githubusercontent.com/5030549/67850181-27598880-fb08-11e9-965c-fae8162e51df.png)
Author
Owner

@StefH commented on GitHub (Oct 30, 2019):

yes, thanks a lot. Wiki has been updated.

@StefH commented on GitHub (Oct 30, 2019): yes, thanks a lot. Wiki has been updated.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#223