Skip to content

Commit a25300a

Browse files
committed
Add swagger annotations and formats to SalesController
1 parent 90c3143 commit a25300a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

NorthwindCRUD/Controllers/SalesController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using Microsoft.AspNetCore.Mvc;
55
using NorthwindCRUD.Models.Dtos;
66
using NorthwindCRUD.Services;
7+
using Swashbuckle.AspNetCore.Annotations;
78

89
namespace NorthwindCRUD.Controllers
910
{
@@ -41,8 +42,8 @@ public ActionResult<SalesDto[]> GetSalesByCategoryAndYear([FromQuery] [Required]
4142
[Authorize]
4243
public ActionResult<SalesDto[]> GetSalesByCountry(
4344
string country,
44-
[FromQuery] [Required] string startDate,
45-
[FromQuery] [Required] string endDate)
45+
[FromQuery] [Required] [DataType(DataType.Date)] [SwaggerParameter("Start date in YYYY-MM-DD format")] string startDate,
46+
[FromQuery] [Required] [DataType(DataType.Date)] [SwaggerParameter("End date in YYYY-MM-DD format")] string endDate)
4647
{
4748
try
4849
{

0 commit comments

Comments
 (0)