Skip to content

Commit 2475463

Browse files
committed
fixes aspnetcore controller when no security defined in spec
1 parent 2f0603a commit 2475463

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/main/resources/handlebars/aspnetcore/2.1/controller.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ using Swashbuckle.AspNetCore.SwaggerGen;
77
using Newtonsoft.Json;
88
using System.ComponentModel.DataAnnotations;
99
using {{packageName}}.Attributes;
10-
using {{packageName}}.Security;
10+
{{#hasAuthMethods}}using {{packageName}}.Security;{{/hasAuthMethods}}
1111
using Microsoft.AspNetCore.Authorization;
1212
using {{modelPackage}};
1313

src/main/resources/handlebars/aspnetcore/Startup.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ using Newtonsoft.Json.Serialization;
1111
using Swashbuckle.AspNetCore.Swagger;
1212
using Swashbuckle.AspNetCore.SwaggerGen;
1313
using {{packageName}}.Filters;
14-
using {{packageName}}.Security;
14+
{{#hasAuthMethods}}using {{packageName}}.Security;{{/hasAuthMethods}}
1515

1616
using Microsoft.AspNetCore.Authentication;
1717

src/main/resources/handlebars/aspnetcore/controller.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ using Swashbuckle.AspNetCore.SwaggerGen;
1414
using Newtonsoft.Json;
1515
using System.ComponentModel.DataAnnotations;
1616
using {{packageName}}.Attributes;
17-
using {{packageName}}.Security;
17+
{{#hasAuthMethods}}using {{packageName}}.Security;{{/hasAuthMethods}}
1818
using {{packageName}}.Models;
1919

2020
namespace {{packageName}}.Controllers

0 commit comments

Comments
 (0)