Provide exact type values for the response when using OpenApi parser. #360

Closed
opened 2025-12-29 15:21:43 +01:00 by adam · 3 comments
Owner

Originally created by @tvytrykush on GitHub (Oct 4, 2021).

Originally assigned to: @StefH on GitHub.

I'm using WithMappingFromOpenApiFile(path, settings, out var diag); and it adds mapping from my file just fine, but I'm stuck with generic type values (42 for int, "example-string" for string) when getting a response. In what way can I adjust these values?

Originally created by @tvytrykush on GitHub (Oct 4, 2021). Originally assigned to: @StefH on GitHub. I'm using `WithMappingFromOpenApiFile(path, settings, out var diag);` and it adds mapping from my file just fine, but I'm stuck with generic type values (42 for int, "example-string" for string) when getting a response. In what way can I adjust these values?
adam added the question label 2025-12-29 15:21:43 +01:00
adam closed this issue 2025-12-29 15:21:43 +01:00
Author
Owner

@StefH commented on GitHub (Oct 4, 2021):

You can provide your own example values to the settings object:

var settings = new WireMockOpenApiParserSettings();
settings.ExampleValues.Integer = 12345;
@StefH commented on GitHub (Oct 4, 2021): You can provide your own example values to the settings object: ``` c# var settings = new WireMockOpenApiParserSettings(); settings.ExampleValues.Integer = 12345; ```
Author
Owner

@tvytrykush commented on GitHub (Oct 4, 2021):

@StefH, is it also possible to specify this values per mapping path?

@tvytrykush commented on GitHub (Oct 4, 2021): @StefH, is it also possible to specify this values per mapping path?
Author
Owner

@StefH commented on GitHub (Oct 5, 2021):

@tvytrykush
No sorry that's not possible.

However. maybe when you add an example in the openapi file, these values are used.

@StefH commented on GitHub (Oct 5, 2021): @tvytrykush No sorry that's not possible. However. maybe when you add an example in the openapi file, these values are used.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#360