diff --git a/src/Simplify.Web.Swagger/ControllerAction.cs b/src/Simplify.Web.Swagger/ControllerAction.cs
index f665274..580e6aa 100644
--- a/src/Simplify.Web.Swagger/ControllerAction.cs
+++ b/src/Simplify.Web.Swagger/ControllerAction.cs
@@ -1,11 +1,7 @@
using System;
using System.Collections.Generic;
-#if NET10_0
using Microsoft.OpenApi;
using NetHttpMethod = System.Net.Http.HttpMethod;
-#else
-using Microsoft.OpenApi.Models;
-#endif
using Simplify.Web.Controllers.Meta.Routing;
namespace Simplify.Web.Swagger;
@@ -46,11 +42,7 @@ public class ControllerAction
///
/// The type.
///
-#if NET10_0
public NetHttpMethod Type { get; set; } = NetHttpMethod.Get;
-#else
- public OperationType Type { get; set; }
-#endif
///
/// Gets the path.
@@ -58,13 +50,8 @@ public class ControllerAction
///
/// The path.
///
-#if NETSTANDARD2_0
- public string Path => ControllerRoute.Path.StartsWith("/") ? ControllerRoute.Path : "/" + ControllerRoute.Path;
-#else
public string Path => ControllerRoute.Path.StartsWith('/') ? ControllerRoute.Path : "/" + ControllerRoute.Path;
-#endif
-
///
/// Gets or sets the controller route.
///
diff --git a/src/Simplify.Web.Swagger/ControllerActionsFactory.cs b/src/Simplify.Web.Swagger/ControllerActionsFactory.cs
index e64a497..e49d076 100644
--- a/src/Simplify.Web.Swagger/ControllerActionsFactory.cs
+++ b/src/Simplify.Web.Swagger/ControllerActionsFactory.cs
@@ -7,12 +7,8 @@
using Simplify.Web.Controllers.Meta.Routing;
using Simplify.Web.Http;
using Swashbuckle.AspNetCore.SwaggerGen;
-#if NET10_0
using Microsoft.OpenApi;
using NetHttpMethod = System.Net.Http.HttpMethod;
-#else
-using Microsoft.OpenApi.Models;
-#endif
namespace Simplify.Web.Swagger;
@@ -127,7 +123,6 @@ private static string FormatNameSource(string str)
return str;
}
-#if NET10_0
private static NetHttpMethod HttpMethodToOperationType(HttpMethod method) =>
method switch
{
@@ -139,19 +134,6 @@ private static NetHttpMethod HttpMethodToOperationType(HttpMethod method) =>
HttpMethod.Options => NetHttpMethod.Options,
_ => NetHttpMethod.Get,
};
-#else
- private static OperationType HttpMethodToOperationType(HttpMethod method) =>
- method switch
- {
- HttpMethod.Get => OperationType.Get,
- HttpMethod.Post => OperationType.Post,
- HttpMethod.Put => OperationType.Put,
- HttpMethod.Patch => OperationType.Patch,
- HttpMethod.Delete => OperationType.Delete,
- HttpMethod.Options => OperationType.Options,
- _ => OperationType.Get,
- };
-#endif
private static OpenApiRequestBody CreateRequestBody(
Type controllerType,
@@ -205,9 +187,7 @@ DocumentFilterContext context
foreach (var item in producesResponse.ContentTypes.Distinct())
{
-#if NET10_0
response.Content ??= new Dictionary();
-#endif
response.Content.Add(
item,
producesResponse.Type is null
diff --git a/src/Simplify.Web.Swagger/EnumNamesSchemaFilter.cs b/src/Simplify.Web.Swagger/EnumNamesSchemaFilter.cs
index 87f1802..6c0bcd2 100644
--- a/src/Simplify.Web.Swagger/EnumNamesSchemaFilter.cs
+++ b/src/Simplify.Web.Swagger/EnumNamesSchemaFilter.cs
@@ -1,14 +1,9 @@
using System;
-using System.Linq;
-using Swashbuckle.AspNetCore.SwaggerGen;
-#if NET10_0
using System.Collections.Generic;
+using System.Linq;
using System.Text.Json.Nodes;
using Microsoft.OpenApi;
-#else
-using Microsoft.OpenApi.Any;
-using Microsoft.OpenApi.Models;
-#endif
+using Swashbuckle.AspNetCore.SwaggerGen;
namespace Simplify.Web.Swagger;
@@ -18,7 +13,6 @@ namespace Simplify.Web.Swagger;
public class EnumNamesSchemaFilter : ISchemaFilter
{
///
-#if NET10_0
public void Apply(IOpenApiSchema schema, SchemaFilterContext context)
{
if (!context.Type.IsEnum)
@@ -38,23 +32,6 @@ public void Apply(IOpenApiSchema schema, SchemaFilterContext context)
concreteSchema.Extensions["x-varnames"] = new JsonNodeExtension(varnames);
concreteSchema.Description = BuildDescription(names, values);
}
-#else
- public void Apply(OpenApiSchema schema, SchemaFilterContext context)
- {
- if (!context.Type.IsEnum)
- return;
-
- var names = Enum.GetNames(context.Type);
- var values = Enum.GetValues(context.Type).Cast