wiremock / wiremock/WireMock.Net

Introduce a flag to strictly enforce the http method

Open
#518 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
C#
Stars
1.7k
Forks
240
Avg merge
5d 12h
Merged PRs (30d)
2

Description

https://github.com/WireMock-Net/WireMock.Net/issues/504

I did notice something else about partial match scores that seemed off. (probably requires a little redesign). For our team to continue using wiremock.net we need to trust that the Http VERB is ALWAYS respected. I've been noticing that, even when a post call is fired, Get matches are being favored (given higher scores) over POST calls (in this case because of the bug mentioned above, the POST call has a lower score because it is failing to match on the body matcher). This seems off. It should match on the highest score, for only a single verb type. I can't imagine a scenario where someone is okay with a get request/response being returned for a post call in an integration test??? That would be a broken integration test to me. Can we introduce a flag to strictly enforce just the verb?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the related issue #504 and trace the HTTP request-matching and partial-score behavior described here. Define how strict verb matching should interact with body-match scores, then verify that POST requests cannot select GET mappings and that existing matching behavior remains covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend-api-design, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.