Support examples random data generation (#673)

* Add Support Random Generation in Examples, this commit add the bool property DynamicExamples.

* Comments applied

* Remove  '#pragma warning disable 1591'
This commit is contained in:
Daniel L. Romero
2021-10-30 02:13:24 -05:00
committed by GitHub
parent ae2a05e86b
commit 77ee123340
6 changed files with 108 additions and 12 deletions

View File

@@ -13,6 +13,14 @@ namespace WireMock.Net.OpenApiParser.Utils
public ExampleValueGenerator(WireMockOpenApiParserSettings settings)
{
_settings = settings ?? throw new ArgumentNullException(nameof(settings));
if (_settings.DynamicExamples)
{
_settings.ExampleValues = new WireMockOpenApiParserDynamicExampleValues();
}
else
{
_settings.ExampleValues = new WireMockOpenApiParserExampleValues();
}
}
public object GetExampleValue(OpenApiSchema schema)