From 2b7ded0f9816741705462eb35deaeeb046473166 Mon Sep 17 00:00:00 2001 From: Chebotov Nikolay Date: Fri, 21 Feb 2020 17:22:13 +0300 Subject: [PATCH] Replace "
" tag to "{Envirinment.NewLine}{Envirinment.NewLine}" for enum descriptions. --- CHANGELOG.md | 4 ++++ .../Extensions/EnumTypeExtensions.cs | 2 +- .../Unchase.Swashbuckle.AspNetCore.Extensions.csproj | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4f591b..f1b8346 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ These are the changes to each version that has been released on the [nuget](https://www.nuget.org/packages/Unchase.Swashbuckle.AspNetCore.Extensions/). +## v2.1.6 `(2020-02-21)` + +- [x] Fix bug: replace `
` tag to `{Envirinment.NewLine}{Envirinment.NewLine}` for enum descriptions + ## v2.1.5 `(2020-02-21)` - [x] Fix bug: fix openApi response content schema in `ChangeResponseByHttpStatusCodeDocumentFilter` diff --git a/src/Unchase.Swashbuckle.AspNetCore.Extensions/Extensions/EnumTypeExtensions.cs b/src/Unchase.Swashbuckle.AspNetCore.Extensions/Extensions/EnumTypeExtensions.cs index 46cb3e2..eaed5f6 100644 --- a/src/Unchase.Swashbuckle.AspNetCore.Extensions/Extensions/EnumTypeExtensions.cs +++ b/src/Unchase.Swashbuckle.AspNetCore.Extensions/Extensions/EnumTypeExtensions.cs @@ -49,7 +49,7 @@ internal static string AddEnumValuesDescription(this OpenApiSchema schema, bool { var value = ((OpenApiInteger)schema.Enum[i]).Value; var name = ((OpenApiString)((OpenApiArray)schema.Extensions["x-enumNames"])[i]).Value; - sb.Append($"
{value} = {name}"); + sb.AppendLine($"{Environment.NewLine}{Environment.NewLine}{value} = {name}"); // add description from DescriptionAttribute if (includeDescriptionFromAttribute) diff --git a/src/Unchase.Swashbuckle.AspNetCore.Extensions/Unchase.Swashbuckle.AspNetCore.Extensions.csproj b/src/Unchase.Swashbuckle.AspNetCore.Extensions/Unchase.Swashbuckle.AspNetCore.Extensions.csproj index 0455202..d555fb5 100644 --- a/src/Unchase.Swashbuckle.AspNetCore.Extensions/Unchase.Swashbuckle.AspNetCore.Extensions.csproj +++ b/src/Unchase.Swashbuckle.AspNetCore.Extensions/Unchase.Swashbuckle.AspNetCore.Extensions.csproj @@ -14,9 +14,9 @@ 7.3 https://github.com/unchase/Unchase.Swashbuckle.AspNetCore.Extensions/blob/master/assets/icon.png?raw=true - 2.1.5 - 2.1.5.0 - 2.1.5.0 + 2.1.6 + 2.1.6.0 + 2.1.6.0 false Unchase.Swashbuckle.AspNetCore.Extensions.xml