mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
Choosing examples from open api specification for responses. #720
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 @PlatWalker on GitHub (Oct 8, 2025).
Originally assigned to: @StefH on GitHub.
Trying to setup some tests for twilio (https://github.com/twilio/twilio-oai) with their open api specification. I downloaded their oai, registered with wiremock method ".WithMappingFromOpenApiFile" everything goes smooth. Problem is that their oai has examples that I want to use. I can't find option to map those examples to wiremock, it seems there is only option to randomly generate values based on schema types? My only option is to read those examples with openapi reader and register desired options manually with ".RespondWith"?
@PlatWalker commented on GitHub (Oct 8, 2025):
Okay I analized wiremock code, I know what is going on!
In method "OpenApiPathsMapper.MapOperationToMappingModel()", field "Example" from "Microsoft.OpenApi.Models.OpenApiMediaType" is used and not "Examples". Twilio oai is using "Examples".
Can I contribute and add option for choosing from multiple examples in PR? Or maybe I missed something and there is such option?
@StefH commented on GitHub (Oct 12, 2025):
@PlatWalker
I think this PR should fix it
https://github.com/wiremock/WireMock.Net/pull/1366
@StefH commented on GitHub (Oct 12, 2025):
@PlatWalker
You can try MyGet
1.14.0.https://wiremock.org/dotnet/myget-preview-versions/
@StefH commented on GitHub (Oct 22, 2025):
@PlatWalker
Did this fix your issue?