mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
Mapping adding order matters for multiple mappings? #211
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gregoks on GitHub (Sep 15, 2019).
hi,
I have a weird behavior for these 2 mappings that I'm adding.
I'm sending the following request:
body:
<xml>555</xml>headers:
I'm creating 2 mappings (dont mind the mapping guids):
The thing that it seems that if I add the first mapping first then its get caught and the other way around then the 2nd mapping gets caught:
example of the admin/requests when first mapping added first:
example of the admin/requests when second mapping added first:
Can you please check if I'm missing anything?
@StefH commented on GitHub (Sep 15, 2019):
The first doesn't have a match on body. Is that intended?
@gregoks commented on GitHub (Sep 15, 2019):
Yes. I want to have 2 mappings where one more strict with specific body and the other more general for requests without such body
@StefH commented on GitHub (Sep 16, 2019):
I see.
The code does just take the first available match:
https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net/Owin/MappingMatcher.cs#L48
Maybe it a good idea to also take into account the number of successful matches.
@gregoks commented on GitHub (Sep 16, 2019):
Oh so it does not matter the total score of the matchings? I would assume that it should return the best matching available and not the first one..
@StefH commented on GitHub (Sep 16, 2019):
@gregoks
Can you try version
WireMock.Net.1.0.30-ci-11883on MyGet?@gregoks commented on GitHub (Sep 16, 2019):
Ill try. Does it include the other bug fixes? Because I already use the WireMock.Net.1.0.31-ci-11865 version.
@StefH commented on GitHub (Sep 17, 2019):
No, this one is only this fix.
The https://github.com/WireMock-Net/WireMock.Net/pull/339 is not included here.
@gregoks commented on GitHub (Sep 17, 2019):
I've tested and its working in WireMock.Net.1.0.30-ci-11883 version. Thanks!!
Do you have an ETA for version that will include all of the current open bug fixes?
Thanks,
Greg
@StefH commented on GitHub (Sep 17, 2019):
No ETA, yet.
Please keep a watch on this project + Nuget.