rbeauchamp / Swashbuckle.OData

Extends Swashbuckle with OData v4 support!
Other
129 stars 96 forks source link

AdjustRelativePathForStringParams is not working case-insensitive (param names) #179

Closed weggetor closed 4 years ago

weggetor commented 6 years ago

In 4.0.0beta2: Swashbuckle.OData/Descriptions/ApiDescriptionExtensions.cs

Better use this:

if (newRelativePathSansQueryString.ToLower().Contains("{" + parameter.Name.ToLower() + "}") && parameterType == typeof (string))
{
    newRelativePathSansQueryString = Regex.Replace(newRelativePathSansQueryString, "{" + parameter.Name + "}", "\'{" + parameter.Name + "}\'", RegexOptions.IgnoreCase);
}