From 0fd2523629b5ea09b6f2029abb1b1dbb9988ee38 Mon Sep 17 00:00:00 2001 From: Stedoss <29103029+Stedoss@users.noreply.github.com> Date: Tue, 1 Nov 2022 20:04:29 +0000 Subject: [PATCH] Add response types for swagger docs gen --- .../LeedsBeerQuest.API/Controllers/CategoryController.cs | 2 ++ .../LeedsBeerQuest.API/Controllers/TagController.cs | 2 ++ .../LeedsBeerQuest.API/Controllers/VenueController.cs | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/backend/LeedsBeerQuest.API/LeedsBeerQuest.API/Controllers/CategoryController.cs b/backend/LeedsBeerQuest.API/LeedsBeerQuest.API/Controllers/CategoryController.cs index 68c9c2b..427b430 100644 --- a/backend/LeedsBeerQuest.API/LeedsBeerQuest.API/Controllers/CategoryController.cs +++ b/backend/LeedsBeerQuest.API/LeedsBeerQuest.API/Controllers/CategoryController.cs @@ -1,3 +1,4 @@ +using LeedsBeerQuest.API.Data.Models; using LeedsBeerQuest.API.Data.Services.Interfaces; using Microsoft.AspNetCore.Mvc; @@ -15,6 +16,7 @@ public class CategoryController : ControllerBase } [HttpGet] + [ProducesResponseType(typeof(Category), StatusCodes.Status200OK)] public async Task GetCategories() { var categories = await _categoryService.GetCategories(); diff --git a/backend/LeedsBeerQuest.API/LeedsBeerQuest.API/Controllers/TagController.cs b/backend/LeedsBeerQuest.API/LeedsBeerQuest.API/Controllers/TagController.cs index de1b6e6..2e23f18 100644 --- a/backend/LeedsBeerQuest.API/LeedsBeerQuest.API/Controllers/TagController.cs +++ b/backend/LeedsBeerQuest.API/LeedsBeerQuest.API/Controllers/TagController.cs @@ -1,3 +1,4 @@ +using LeedsBeerQuest.API.Data.Models; using LeedsBeerQuest.API.Data.Services.Interfaces; using Microsoft.AspNetCore.Mvc; @@ -15,6 +16,7 @@ public class TagController : ControllerBase } [HttpGet] + [ProducesResponseType(typeof(Tag), StatusCodes.Status200OK)] public async Task GetTags() { var tags = await _tagService.GetTags(); diff --git a/backend/LeedsBeerQuest.API/LeedsBeerQuest.API/Controllers/VenueController.cs b/backend/LeedsBeerQuest.API/LeedsBeerQuest.API/Controllers/VenueController.cs index bcb58ed..5ce634f 100644 --- a/backend/LeedsBeerQuest.API/LeedsBeerQuest.API/Controllers/VenueController.cs +++ b/backend/LeedsBeerQuest.API/LeedsBeerQuest.API/Controllers/VenueController.cs @@ -1,3 +1,4 @@ +using LeedsBeerQuest.API.Data.Models; using LeedsBeerQuest.API.Data.Services.Interfaces; using Microsoft.AspNetCore.Mvc; @@ -14,6 +15,7 @@ public class VenueController : ControllerBase _venueService = venueService; } + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] [HttpGet] public async Task GetVenues( [FromQuery] string? search = null, @@ -25,6 +27,9 @@ public class VenueController : ControllerBase return Ok(venues); } + [ProducesResponseType(typeof(Venue), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status404NotFound)] [HttpGet("{venueId:int}")] public async Task GetVenue(int venueId) {