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.35k stars 197 forks source link

When using C# code generation WithBody() matcher is not generated for POST Request #1095

Closed asos-alexhaigh closed 1 month ago

asos-alexhaigh commented 2 months ago

Describe the bug

When you generate C# code using MappingConverterType=Builder the created code doesn't contains .WithBody for the request.

Expected behavior:

A clear and concise description of what you expected to happen.

Test to reproduce

        builder
            .Given(Request.Create()
                .UsingMethod("POST")
                .WithPath("/rest/v4/users")
                .WithHeader("Accept", "*/*", true)
                .WithHeader("Connection", "keep-alive", true)
                .WithHeader("User-Agent", "PostmanRuntime/7.37.3", true)
                .WithHeader("Accept-Encoding", "gzip, deflate, br", true)
                .WithHeader("Content-Type", "application/json", true)
                .WithHeader("Content-Length", "443", true)
                .WithHttpVersion("1.1")
            )
            .WithGuid("66cb85f5-6a2c-4f67-b685-3fcb9275e17a");
StefH commented 1 month ago

Thanks for the detailed description, I'll take look.

StefH commented 1 month ago

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

StefH commented 1 month ago

Solved