Skip to content

Commit

Permalink
doc: updated openapi documentation
Browse files Browse the repository at this point in the history
Co-authored-by: Philipp Wörndle <[email protected]>
Signed-off-by: Stefan Pfahler <[email protected]>
  • Loading branch information
stefanpfahler and woerndle committed Dec 31, 2022
1 parent 68d62e6 commit d368af9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
33 changes: 19 additions & 14 deletions src/deskstar-backend/Deskstar/Controllers/ResourcesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public ResourcesController(ILogger<ResourcesController> logger, IResourceUsecase
/// </remarks>
///
/// <response code="200">Returns the buildings list</response>
/// <response code="400">Bad Request</response>
/// <response code="500">Internal Server Error</response>
[HttpGet("buildings")]
[Authorize]
Expand Down Expand Up @@ -67,7 +68,7 @@ public IActionResult GetAllBuildings()
/// POST /resources/buildings with JWT-Admin Token
/// </remarks>
///
/// <response code="200">Ok</response>
/// <response code="200">CreateBuildingResponseObject</response>
/// <response code="400">Bad Request</response>
/// <response code="404">Not Found</response>
/// <response code="500">Internal Server Error</response>
Expand Down Expand Up @@ -114,8 +115,8 @@ public IActionResult CreateBuilding(CreateBuildingDto buildingDto)
/// DELETE /resources/buildings/3de7afbf-0289-4ba6-bada-a34353c5548a with JWT-Admin Token
/// </remarks>
///
/// <response code="205"></response>
/// <response code="500">Internal Server Error</response>
/// <response code="400">Bad Request</response>
/// <response code="501">Not Implemented</response>
[HttpDelete("buildings/{buildingId}")]
[Authorize(Policy = "Admin")]
[ProducesResponseType(StatusCodes.Status205ResetContent)]
Expand All @@ -137,6 +138,7 @@ public IActionResult DeleteBuilding(string buildingId)
/// </remarks>
///
/// <response code="200">Returns the floor list</response>
/// <response code="400">Bad Request</response>
/// <response code="500">Internal Server Error</response>
[HttpGet("buildings/{buildingId}/floors")]
[Authorize]
Expand Down Expand Up @@ -166,7 +168,7 @@ public IActionResult GetFloorsByBuildingId(string buildingId)
/// POST /resources/floors with JWT-Admin Token
/// </remarks>
///
/// <response code="200">Ok</response>
/// <response code="200">CreateFloorResponseObject</response>
/// <response code="400">Bad Request</response>
/// <response code="404">Not Found</response>
/// <response code="500">Internal Server Error</response>
Expand Down Expand Up @@ -212,8 +214,8 @@ public IActionResult CreateFloor(CreateFloorDto floorDto)
/// DELETE /resources/floors/3de7afbf-0289-4ba6-bada-a34353c5548a with JWT-Admin Token
/// </remarks>
///
/// <response code="205"></response>
/// <response code="500">Internal Server Error</response>
/// <response code="400">Bad Request</response>
/// <response code="501">Not Impelemented</response>
[HttpDelete("floors/{floorId}")]
[Authorize(Policy = "Admin")]
[ProducesResponseType(StatusCodes.Status205ResetContent)]
Expand All @@ -234,6 +236,7 @@ public IActionResult DeleteFloor(string floorId)
/// </remarks>
///
/// <response code="200">Returns the rooms list</response>
/// <response code="400">Bad Request</response>
/// <response code="500">Internal Server Error</response>
[HttpGet("floors/{floorId}/rooms")]
[Authorize]
Expand Down Expand Up @@ -263,7 +266,7 @@ public IActionResult GetRoomsByFloorId(string floorId)
/// POST /resources/rooms with JWT-Admin Token
/// </remarks>
///
/// <response code="200">Ok</response>
/// <response code="200">CreateRoomResponseObject</response>
/// <response code="400">Bad Request</response>
/// <response code="404">Not Found</response>
/// <response code="500">Internal Server Error</response>
Expand Down Expand Up @@ -310,8 +313,8 @@ public IActionResult CreateRoom(CreateRoomDto roomDto)
/// DELETE /resources/rooms/3de7afbf-0289-4ba6-bada-a34353c5548a with JWT-Admin Token
/// </remarks>
///
/// <response code="205"></response>
/// <response code="500">Internal Server Error</response>
/// <response code="400">Bad Request</response>
/// <response code="501">Not Implemented</response>
[HttpDelete("rooms/{roomId}")]
[Authorize(Policy = "Admin")]
[ProducesResponseType(StatusCodes.Status205ResetContent)]
Expand All @@ -333,6 +336,7 @@ public IActionResult DeleteRoom(string roomId)
/// </remarks>
///
/// <response code="200">Returns the desks list</response>
/// <response code="400">Bad Request</response>
/// <response code="500">Internal Server Error</response>
[HttpGet("rooms/{roomId}/desks")]
[Authorize]
Expand Down Expand Up @@ -420,7 +424,7 @@ public IActionResult GetDeskDetailsByDeskId(string deskId, long start = 0, long
/// POST /resources/desks with JWT-Admin Token
/// </remarks>
///
/// <response code="200">Ok</response>
/// <response code="200">CreateDeskResponseObject</response>
/// <response code="400">Bad Request</response>
/// <response code="404">Not Found</response>
/// <response code="500">Internal Server Error</response>
Expand Down Expand Up @@ -468,8 +472,8 @@ public IActionResult CreateDesk(CreateDeskDto deskDto)
/// DELETE /resources/desks/3de7afbf-0289-4ba6-bada-a34353c5548a with JWT-Admin Token
/// </remarks>
///
/// <response code="205"></response>
/// <response code="500">Internal Server Error</response>
/// <response code="400">Bad Request</response>
/// <response code="501">Not Implemented</response>
[HttpDelete("desks/{deskId}")]
[Authorize(Policy = "Admin")]
[ProducesResponseType(StatusCodes.Status205ResetContent)]
Expand All @@ -488,8 +492,8 @@ public IActionResult DeleteDesk(string deskId)
/// POST /resources/desktypes with JWT-Admin Token
/// </remarks>
///
/// <response code="201"></response>
/// <response code="400"></response>
/// <response code="200">CreateDeskTypeResponseObject</response>
/// <response code="400">Bad Request</response>
/// <response code="500">Internal Server Error</response>
[HttpPost("desktypes")]
[Authorize(Policy = "Admin")]
Expand Down Expand Up @@ -522,6 +526,7 @@ public IActionResult CreateDeskType(CreateDeskTypeDto deskTypeDto)
/// </remarks>
///
/// <response code="200">List<DeskTypeDto></response>
/// <response code="400">Bad Request</response>
/// <response code="500">Internal Server Error</response>
[HttpGet("desktypes")]
[Authorize(Policy = "Admin")]
Expand Down
1 change: 0 additions & 1 deletion src/deskstar-frontend/lib/api/ResourceService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ export async function createDeskType(
}
}

console.log("x");
return result;
}
type CreateDeskDto = {
Expand Down

0 comments on commit d368af9

Please sign in to comment.