WireMock.Net icon indicating copy to clipboard operation
WireMock.Net copied to clipboard

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

Open Cherepoc opened this issue 1 year ago • 3 comments

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!

Cherepoc avatar Jun 12 '24 20:06 Cherepoc

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

StefH avatar Jun 19 '24 10:06 StefH

@Cherepoc

Can you try preview version 1.5.58-ci-18736?

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

StefH avatar Jun 19 '24 10:06 StefH

@Cherepoc did you have time to test this version?

StefH avatar Jun 29 '24 10:06 StefH

@Cherepoc did you have time to test this version?

StefH avatar Jul 03 '24 15:07 StefH

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

Cherepoc avatar Jul 06 '24 07:07 Cherepoc

@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.

Cherepoc avatar Jul 16 '24 20:07 Cherepoc

I will create a new preview version tomorrow.

StefH avatar Jul 16 '24 21:07 StefH

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

StefH avatar Jul 17 '24 05:07 StefH

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

Cherepoc avatar Jul 22 '24 18:07 Cherepoc

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

StefH avatar Jul 22 '24 19:07 StefH