diff --git a/src/WireMock.Net.OpenApiParser/Mappers/OpenApiPathsMapper.cs b/src/WireMock.Net.OpenApiParser/Mappers/OpenApiPathsMapper.cs
index 6ba31052..e4f9d361 100644
--- a/src/WireMock.Net.OpenApiParser/Mappers/OpenApiPathsMapper.cs
+++ b/src/WireMock.Net.OpenApiParser/Mappers/OpenApiPathsMapper.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -115,6 +115,7 @@ namespace WireMock.Net.OpenApiParser.Mappers
requestBodyModel.Matcher = new MatcherModel();
requestBodyModel.Matcher.Name = "JsonMatcher";
requestBodyModel.Matcher.Pattern = JsonConvert.SerializeObject(requestBody, Formatting.Indented);
+ requestBodyModel.Matcher.IgnoreCase = _settings.IgnoreCaseRequestBody;
return requestBodyModel;
}
@@ -327,6 +328,7 @@ namespace WireMock.Net.OpenApiParser.Mappers
.Select(qp => new ParamModel
{
Name = qp.Name,
+ IgnoreCase = _settings.IgnoreCaseQueryParams,
Matchers = new[]
{
GetExampleMatcherModel(qp.Schema, _settings.QueryParameterPatternToUse)
@@ -344,6 +346,7 @@ namespace WireMock.Net.OpenApiParser.Mappers
.Select(qp => new HeaderModel
{
Name = qp.Name,
+ IgnoreCase = _settings.IgnoreCaseHeaders,
Matchers = new[]
{
GetExampleMatcherModel(qp.Schema, _settings.HeaderPatternToUse)
@@ -358,7 +361,7 @@ namespace WireMock.Net.OpenApiParser.Mappers
{
return type switch
{
- ExampleValueType.Value => new MatcherModel { Name = "ExactMatcher", Pattern = GetExampleValueAsStringForSchemaType(schema) },
+ ExampleValueType.Value => new MatcherModel { Name = "ExactMatcher", Pattern = GetExampleValueAsStringForSchemaType(schema), IgnoreCase = _settings.IgnoreCaseExampleValues },
_ => new MatcherModel { Name = "WildcardMatcher", Pattern = "*" }
};
diff --git a/src/WireMock.Net.OpenApiParser/Settings/WireMockOpenApiParserSettings.cs b/src/WireMock.Net.OpenApiParser/Settings/WireMockOpenApiParserSettings.cs
index 4a0ec439..75cc99e7 100644
--- a/src/WireMock.Net.OpenApiParser/Settings/WireMockOpenApiParserSettings.cs
+++ b/src/WireMock.Net.OpenApiParser/Settings/WireMockOpenApiParserSettings.cs
@@ -36,5 +36,25 @@ namespace WireMock.Net.OpenApiParser.Settings
/// Are examples generated dynamically?
///
public bool DynamicExamples { get; set; } = false;
+
+ ///
+ /// Is headers case sensitive? (default is true).
+ ///
+ public bool IgnoreCaseHeaders { get; set; } = true;
+
+ ///
+ /// Is query params case sensitive? (default is true).
+ ///
+ public bool IgnoreCaseQueryParams { get; set; } = true;
+
+ ///
+ /// Is request body case sensitive? (default is true).
+ ///
+ public bool IgnoreCaseRequestBody { get; set; } = true;
+
+ ///
+ /// Are example values case sensitive? (default is true).
+ ///
+ public bool IgnoreCaseExampleValues { get; set; } = true;
}
}
\ No newline at end of file