Add response types for swagger docs gen

This commit is contained in:
Stedoss 2022-11-01 20:04:29 +00:00
parent b19f46ff92
commit 0fd2523629
3 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,4 @@
using LeedsBeerQuest.API.Data.Models;
using LeedsBeerQuest.API.Data.Services.Interfaces; using LeedsBeerQuest.API.Data.Services.Interfaces;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
@ -15,6 +16,7 @@ public class CategoryController : ControllerBase
} }
[HttpGet] [HttpGet]
[ProducesResponseType(typeof(Category), StatusCodes.Status200OK)]
public async Task<IActionResult> GetCategories() public async Task<IActionResult> GetCategories()
{ {
var categories = await _categoryService.GetCategories(); var categories = await _categoryService.GetCategories();

View File

@ -1,3 +1,4 @@
using LeedsBeerQuest.API.Data.Models;
using LeedsBeerQuest.API.Data.Services.Interfaces; using LeedsBeerQuest.API.Data.Services.Interfaces;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
@ -15,6 +16,7 @@ public class TagController : ControllerBase
} }
[HttpGet] [HttpGet]
[ProducesResponseType(typeof(Tag), StatusCodes.Status200OK)]
public async Task<IActionResult> GetTags() public async Task<IActionResult> GetTags()
{ {
var tags = await _tagService.GetTags(); var tags = await _tagService.GetTags();

View File

@ -1,3 +1,4 @@
using LeedsBeerQuest.API.Data.Models;
using LeedsBeerQuest.API.Data.Services.Interfaces; using LeedsBeerQuest.API.Data.Services.Interfaces;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
@ -14,6 +15,7 @@ public class VenueController : ControllerBase
_venueService = venueService; _venueService = venueService;
} }
[ProducesResponseType(typeof(IEnumerable<Venue>), StatusCodes.Status200OK)]
[HttpGet] [HttpGet]
public async Task<IActionResult> GetVenues( public async Task<IActionResult> GetVenues(
[FromQuery] string? search = null, [FromQuery] string? search = null,
@ -25,6 +27,9 @@ public class VenueController : ControllerBase
return Ok(venues); return Ok(venues);
} }
[ProducesResponseType(typeof(Venue), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[HttpGet("{venueId:int}")] [HttpGet("{venueId:int}")]
public async Task<IActionResult> GetVenue(int venueId) public async Task<IActionResult> GetVenue(int venueId)
{ {