Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

API - CollectionLayout - add ProducesResponseType

KrzysztofPajak61669c026b3e
diff --git a/src/API/Grand.Api/Controllers/OData/CollectionLayoutController.cs b/src/API/Grand.Api/Controllers/OData/CollectionLayoutController.cs
index a4f2c5030..79aa80886 100644
--- a/src/API/Grand.Api/Controllers/OData/CollectionLayoutController.cs
+++ b/src/API/Grand.Api/Controllers/OData/CollectionLayoutController.cs
@@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.OData.Query;
using Swashbuckle.AspNetCore.Annotations;
using System.Linq;
+using System.Net;
using System.Threading.Tasks;
namespace Grand.Api.Controllers.OData
@@ -23,6 +24,9 @@ namespace Grand.Api.Controllers.OData
[SwaggerOperation(summary: "Get entity from CollectionLayout by key", OperationId = "GetCollectionLayoutById")]
[HttpGet("{key}")]
+ [ProducesResponseType((int)HttpStatusCode.Forbidden)]
+ [ProducesResponseType((int)HttpStatusCode.OK)]
+ [ProducesResponseType((int)HttpStatusCode.NotFound)]
public async Task<IActionResult> Get(string key)
{
if (!await _permissionService.Authorize(PermissionSystemName.Maintenance))
@@ -38,6 +42,8 @@ namespace Grand.Api.Controllers.OData
[SwaggerOperation(summary: "Get entities from CollectionLayout", OperationId = "GetCollectionLayouts")]
[HttpGet]
[EnableQuery(HandleNullPropagation = HandleNullPropagationOption.False)]
+ [ProducesResponseType((int)HttpStatusCode.Forbidden)]
+ [ProducesResponseType((int)HttpStatusCode.OK)]
public async Task<IActionResult> Get()
{
if (!await _permissionService.Authorize(PermissionSystemName.Maintenance))