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.39k stars 207 forks source link

Generating mappings from Payroc open-api file gives ArgumentException: Property with the same name already exists on object #1118

Closed Cherepoc closed 2 months ago

Cherepoc commented 3 months ago

Hi! I'm trying to use WireMock for testing my Payroc integration. There's an open-api file I thought I could use to generate the client mock, but when I use WithMappingFromOpenApiFile method, it gives me the following error:

Unhandled exception. System.ArgumentException: Can not add property orderId to Newtonsoft.Json.Linq.JObject. Property with the same name already exists on object.

I used several tools to generate the C# client classes from the very same open-api file, and all of them succeeded and did not have any critical errors. The open-api file Example on dotnet fiddle Hope this can be fixed. Thanks!

StefH commented 3 months ago

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

StefH commented 3 months ago

@Cherepoc

Can you try preview version 1.5.58-ci-18736?

See https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions

StefH commented 3 months ago

@Cherepoc did you have time to test this version?

StefH commented 2 months ago

@Cherepoc did you have time to test this version?

Cherepoc commented 2 months ago

@StefH Thanks! I'll test it in a few days.

Cherepoc commented 2 months ago

@StefH Sorry for the delay. The error is still there EDIT. Actually that version is not available anymore. I've tried other ones, they still give me error.

StefH commented 2 months ago

I will create a new preview version tomorrow.

StefH commented 2 months ago

@Cherepoc Can you try preview 1.5.60-ci-18958?

Cherepoc commented 2 months ago

@StefH Just tried it and now it works. Thanks!

StefH commented 2 months ago

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