WireMock-Net / WireMock.Net

WireMock.Net is a flexible product for stubbing and mocking web HTTP responses using advanced request matching and response templating. Based on the functionality from http://WireMock.org, but extended with more functionality.
Apache License 2.0
1.36k stars 200 forks source link

RequestMessage.GetParameter method missing from IRequestMessage interface #941

Closed ShortIsLong closed 1 year ago

ShortIsLong commented 1 year ago

The RequestMessage.GetParameter method seems to be missing from the IRequestMessage interface. Wasn't sure if this is intentional or an oversight? Thanks.

https://github.com/WireMock-Net/WireMock.Net/blob/3956cd703b0343686b1e6981aca24b027bfe8545/src/WireMock.Net/RequestMessage.cs#L189

https://github.com/WireMock-Net/WireMock.Net/blob/3956cd703b0343686b1e6981aca24b027bfe8545/src/WireMock.Net.Abstractions/IRequestMessage.cs#L14

StefH commented 1 year ago

@ShortIsLong I think that for now this method is only used internally.

Do you need it ?

ShortIsLong commented 1 year ago

Our codebase is making use of the method to pull query values from the request and then build a response based the provided values. We can cast for now to RequestMessage and call the method that way (although it feels a bit unnecessary maybe?) but if the intent is to eventually make this internal then we'd have to roll our own version which would essentially be the same method. Is there some other mechanism we should be using to build a response based on the request param values rather than using GetParameter() inside the Response.WithBody() method? Apologies if this has been covered elsewhere.

StefH commented 1 year ago

Thanks for your explanation.

If you really need it, I'll add this method to the interface.

StefH commented 1 year ago

https://github.com/WireMock-Net/WireMock.Net/pull/942

ShortIsLong commented 1 year ago

Thanks for the quick turnaround! Much appreciated.