question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Admin API fails to create a mapping with Request Body matching

See original GitHub issue

Describe the bug

Admin API is used to create a mapping which has some sort of request body match, but other matches get created except body.

Expected behavior:

Body match should appear when querying GET __admin/mappings.

Test to reproduce

Admin API is used to create the following mapping.

var model = new MappingModel
{
    Request = new RequestModel
    {
        Path = "test",
        Body = new BodyModel
        {
            Matcher = new MatcherModel
            {
                Name = "RegexMatcher",
                Pattern = "hello"
            }
        }
    },
    Response = new ResponseModel
    {
        Body = "world"
    }
};
await RestClient.For<IWireMockAdminApi>("http://localhost").PostMappingAsync(model);

The response from GET __admin/mappings

[
  {
    "Guid": "486b7f76-f29a-4928-9f16-bf6c3a2ce8f2",
    "Request": {
      "Path": {
        "Matchers": [
          {
            "Name": "WildcardMatcher",
            "Pattern": "test",
            "IgnoreCase": false
          }
        ]
      }
    },
    "Response": {
      "Body": "world"
    }
  }
]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
StefHcommented, Jul 9, 2020

Fixed. New NuGet and Docker will be released soon.

0reactions
yunjcommented, Jul 9, 2020

@StefH thanks very much for your quick fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to match desired schema for api - python
Im unable to formulate accurately enough this PUT request to the GoDaddy v1 domains api to update my A record. The only data...
Read more >
Matching and filtering HTTP requests in WireMock
Matching other attributes. All request attributes other than the URL can be matched using the following set of operators.
Read more >
there are no stub mappings in this WireMock instance
I found solution for this. So, basically we need create a folder called "mappings" (exact name) under the directory identified by ...
Read more >
Returning stubbed HTTP responses to specific requests
A core feature of WireMock is the ability to return canned HTTP responses for requests matching criteria. These are described in detail in...
Read more >
Wiremock Stubbing, Stub Verification And Proxying With ...
#3) The above command will create a mapping in Wiremock and will route all the requests URL matching “/serviceB” to host www.google.com.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found