[ASPNETCORE 3.x] Microsoft.AspNetCore.Authorization directive no longer requires useSwashbuckle condition (#8368)

* Update controller.mustache

Moved using directive for Microsoft.AspNetCore.Authorization outside of useSwashbuckle tag to prevent compilation errors with Authorize tag if Swashbuckle is disabled.

* Updated aspnetcore-3.x samples
This commit is contained in:
leonluc-dev 2021-03-27 02:56:37 +01:00 committed by GitHub
parent 5abf020be3
commit 7e6ce69c64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 6 deletions

View File

@ -5,11 +5,11 @@ using System.ComponentModel.DataAnnotations;
{{#operationResultTask}} {{#operationResultTask}}
using System.Threading.Tasks; using System.Threading.Tasks;
{{/operationResultTask}} {{/operationResultTask}}
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
{{#useSwashbuckle}} {{#useSwashbuckle}}
using Swashbuckle.AspNetCore.Annotations; using Swashbuckle.AspNetCore.Annotations;
using Microsoft.AspNetCore.Authorization;
using Swashbuckle.AspNetCore.SwaggerGen; using Swashbuckle.AspNetCore.SwaggerGen;
{{/useSwashbuckle}} {{/useSwashbuckle}}
{{^isLibrary}} {{^isLibrary}}

View File

@ -11,10 +11,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Swashbuckle.AspNetCore.Annotations; using Swashbuckle.AspNetCore.Annotations;
using Microsoft.AspNetCore.Authorization;
using Swashbuckle.AspNetCore.SwaggerGen; using Swashbuckle.AspNetCore.SwaggerGen;
using Newtonsoft.Json; using Newtonsoft.Json;
using Org.OpenAPITools.Attributes; using Org.OpenAPITools.Attributes;

View File

@ -11,10 +11,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Swashbuckle.AspNetCore.Annotations; using Swashbuckle.AspNetCore.Annotations;
using Microsoft.AspNetCore.Authorization;
using Swashbuckle.AspNetCore.SwaggerGen; using Swashbuckle.AspNetCore.SwaggerGen;
using Newtonsoft.Json; using Newtonsoft.Json;
using Org.OpenAPITools.Attributes; using Org.OpenAPITools.Attributes;

View File

@ -11,10 +11,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Swashbuckle.AspNetCore.Annotations; using Swashbuckle.AspNetCore.Annotations;
using Microsoft.AspNetCore.Authorization;
using Swashbuckle.AspNetCore.SwaggerGen; using Swashbuckle.AspNetCore.SwaggerGen;
using Newtonsoft.Json; using Newtonsoft.Json;
using Org.OpenAPITools.Attributes; using Org.OpenAPITools.Attributes;

View File

@ -11,10 +11,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Swashbuckle.AspNetCore.Annotations; using Swashbuckle.AspNetCore.Annotations;
using Microsoft.AspNetCore.Authorization;
using Swashbuckle.AspNetCore.SwaggerGen; using Swashbuckle.AspNetCore.SwaggerGen;
using Newtonsoft.Json; using Newtonsoft.Json;
using Org.OpenAPITools.Attributes; using Org.OpenAPITools.Attributes;

View File

@ -11,6 +11,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Swashbuckle.AspNetCore.Annotations; using Swashbuckle.AspNetCore.Annotations;

View File

@ -11,10 +11,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Swashbuckle.AspNetCore.Annotations; using Swashbuckle.AspNetCore.Annotations;
using Microsoft.AspNetCore.Authorization;
using Swashbuckle.AspNetCore.SwaggerGen; using Swashbuckle.AspNetCore.SwaggerGen;
using Newtonsoft.Json; using Newtonsoft.Json;
using Org.OpenAPITools.Attributes; using Org.OpenAPITools.Attributes;