Skip to content

Commit

Permalink
Enable implicit usings and remove unused (#5040)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma authored Nov 22, 2024
1 parent f54e2c8 commit 1278e0b
Show file tree
Hide file tree
Showing 162 changed files with 37 additions and 395 deletions.
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<RepositoryUrl>https://github.com/RicoSuter/NSwag.git</RepositoryUrl>

<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>

<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!-- suppress NuGet audit checks being errors -->
Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.Annotations/OpenApiBodyParameterAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;

namespace NSwag.Annotations
{
/// <summary>Specifies that the operation consumes the POST body.</summary>
Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.Annotations/OpenApiControllerAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;

namespace NSwag.Annotations
{
/// <summary>Describes the controller.</summary>
Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.Annotations/OpenApiExtensionDataAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;

namespace NSwag.Annotations
{
/// <summary>Indicates extension data to be added to the Swagger definition.</summary>
Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.Annotations/OpenApiFileAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;

namespace NSwag.Annotations
{
/// <summary>Specifies a parameter or class to be handled as file.</summary>
Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.Annotations/OpenApiIgnoreAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;

namespace NSwag.Annotations
{
/// <summary>Excludes an action method from the generated Swagger specification.</summary>
Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.Annotations/OpenApiOperationAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;

namespace NSwag.Annotations
{
/// <summary>Specifies the operation id, summary and description</summary>
Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.Annotations/OpenApiOperationProcessorAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;

namespace NSwag.Annotations
{
/// <summary>Registers an operation processor for the given method or class.</summary>
Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.Annotations/OpenApiTagAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;

namespace NSwag.Annotations
{
/// <summary>Specifies the tags for an operation.</summary>
Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.Annotations/OpenApiTagsAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;

namespace NSwag.Annotations
{
/// <summary>Specifies the tags for an operation or a document.</summary>
Expand Down
1 change: 0 additions & 1 deletion src/NSwag.Annotations/ResponseTypeAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using System.Net;

namespace NSwag.Annotations
Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.Annotations/SwaggerDefaultResponseAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;

namespace NSwag.Annotations
{
/// <summary>Specifies that a default response (HTTP 200/204) should be generated from the return type of the operation method
Expand Down
1 change: 0 additions & 1 deletion src/NSwag.Annotations/SwaggerResponseAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using System.Net;

namespace NSwag.Annotations
Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.Annotations/WillReadBodyAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;

namespace NSwag.Annotations
{
/// <summary>Specifies whether the parameter or class reads the body.</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Runtime.ExceptionServices;
using System.Threading.Tasks;
using Microsoft.Owin;
using NSwag.Generation.WebApi;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using System.Threading.Tasks;
using Microsoft.Owin;

namespace NSwag.AspNet.Owin.Middlewares
Expand Down
4 changes: 0 additions & 4 deletions src/NSwag.AspNet.Owin/Middlewares/SwaggerUiIndexMiddleware.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Owin;
using NSwag.Generation;

Expand Down
3 changes: 0 additions & 3 deletions src/NSwag.AspNet.Owin/SwaggerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.Owin;
using Microsoft.Owin.Extensions;
Expand Down
3 changes: 0 additions & 3 deletions src/NSwag.AspNet.WebApi/JsonExceptionFilterAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Reflection;
Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.AspNetCore/ApiverseUiSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
//-----------------------------------------------------------------------

using Microsoft.AspNetCore.Http;
using System.Threading;
using System.Threading.Tasks;

namespace NSwag.AspNetCore
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
using Microsoft.Extensions.Options;
using NSwag.AspNetCore;
using NSwag.AspNetCore.Middlewares;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;

namespace Microsoft.AspNetCore.Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.ApiDescriptions;
using Microsoft.Extensions.Options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using NSwag;
using NSwag.Generation;
using NSwag.Generation.Processors.Security;
using System.Collections.Generic;

namespace Microsoft.Extensions.DependencyInjection
{
Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.AspNetCore/HttpRequestExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using System.Linq;
#if AspNetOwin
using Microsoft.Owin;

Expand Down
4 changes: 0 additions & 4 deletions src/NSwag.AspNetCore/IDocumentProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;

namespace Microsoft.Extensions.ApiDescriptions
{
// This service will be looked up by name from the service collection when using
Expand Down
4 changes: 0 additions & 4 deletions src/NSwag.AspNetCore/JsonExceptionFilterAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Filters;
using Newtonsoft.Json;
using NJsonSchema.Converters;
using NJsonSchema.NewtonsoftJson.Converters;
using NSwag.Annotations;
using NSwag.Generation.AspNetCore;
Expand Down
4 changes: 0 additions & 4 deletions src/NSwag.AspNetCore/Middlewares/OpenApiDocumentMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.Extensions.DependencyInjection;
using Namotion.Reflection;
using System;
using System.Collections.Generic;
using System.Runtime.ExceptionServices;
using System.Threading;
using System.Threading.Tasks;

namespace NSwag.AspNetCore.Middlewares
{
Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.AspNetCore/Middlewares/RedirectToIndexMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;

namespace NSwag.AspNetCore.Middlewares
Expand Down
3 changes: 0 additions & 3 deletions src/NSwag.AspNetCore/Middlewares/SwaggerUiIndexMiddleware.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;

namespace NSwag.AspNetCore.Middlewares
Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.AspNetCore/OAuth2ClientSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System.Collections.Generic;

#if AspNetOwin
namespace NSwag.AspNet.Owin
#else
Expand Down
1 change: 0 additions & 1 deletion src/NSwag.AspNetCore/OpenApiDocumentMiddlewareSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//-----------------------------------------------------------------------

using Microsoft.AspNetCore.Http;
using System;

namespace NSwag.AspNetCore
{
Expand Down
5 changes: 0 additions & 5 deletions src/NSwag.AspNetCore/OpenApiDocumentProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.ApiDescriptions;
using Microsoft.Extensions.DependencyInjection;
using NSwag.Generation;
Expand Down
6 changes: 3 additions & 3 deletions src/NSwag.AspNetCore/ReDocSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

#pragma warning disable IDE0005

using NSwag.Generation;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Threading;

#if AspNetOwin
using Microsoft.Owin;

Expand Down
7 changes: 2 additions & 5 deletions src/NSwag.AspNetCore/SwaggerSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using Newtonsoft.Json;
#pragma warning disable IDE0005

using NSwag.Generation;

#if AspNetOwin
using NSwag.Generation.WebApi;
using Microsoft.Owin;

namespace NSwag.AspNet.Owin
#else
namespace NSwag.AspNetCore
Expand Down
8 changes: 2 additions & 6 deletions src/NSwag.AspNetCore/SwaggerUiSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
#pragma warning disable IDE0005

using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using Newtonsoft.Json;
using NSwag.Generation;
using NJsonSchema;
using System.Threading;
using System.Threading.Tasks;

#if AspNetOwin
using Microsoft.Owin;
Expand Down
10 changes: 3 additions & 7 deletions src/NSwag.AspNetCore/SwaggerUiSettingsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

#pragma warning disable IDE0005

using NSwag.Generation;
using System;
using System.Collections.Generic;
using NJsonSchema;
using System.Globalization;
using Newtonsoft.Json;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

#if AspNetOwin
using Microsoft.Owin;

Expand Down
2 changes: 0 additions & 2 deletions src/NSwag.CodeGeneration.CSharp/CSharpClientGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using NJsonSchema.CodeGeneration;
using NJsonSchema.CodeGeneration.CSharp;
using NSwag.CodeGeneration.CSharp.Models;
Expand Down
3 changes: 0 additions & 3 deletions src/NSwag.CodeGeneration.CSharp/CSharpControllerGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using NJsonSchema.CodeGeneration;
using NJsonSchema.CodeGeneration.CSharp;
using NSwag.CodeGeneration.CSharp.Models;
Expand Down
Loading

0 comments on commit 1278e0b

Please sign in to comment.