Skip to content

Commit

Permalink
Mark the request body as required.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTedder committed Sep 29, 2024
1 parent e4fbd7a commit b3e806f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LeaderboardBackend/Controllers/LeaderboardsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ [FromQuery] long[] ids
[SwaggerResponse(409, "A Leaderboard with the specified slug already exists.", typeof(ValidationProblemDetails))]
[SwaggerResponse(422, $"The request contains errors. The following errors can occur: NotEmptyValidator, {SlugRule.SLUG_FORMAT}", Type = typeof(ValidationProblemDetails))]
public async Task<ActionResult<LeaderboardViewModel>> CreateLeaderboard(
[FromBody] CreateLeaderboardRequest request
[FromBody, SwaggerRequestBody(Required = true)] CreateLeaderboardRequest request
)
{
CreateLeaderboardResult r = await leaderboardService.CreateLeaderboard(request);
Expand Down
3 changes: 2 additions & 1 deletion LeaderboardBackend/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,8 @@
"$ref": "#/components/schemas/CreateLeaderboardRequest"
}
}
}
},
"required": true
},
"responses": {
"400": {
Expand Down

0 comments on commit b3e806f

Please sign in to comment.