Use generic ProducesResponseTypeAttribute instead of typeof(...) (#3074)

This commit is contained in:
Sebastian Göls
2023-11-16 21:49:15 +01:00
committed by GitHub
parent 5cbe11241c
commit 193f0e3c08
14 changed files with 82 additions and 82 deletions

View File

@@ -39,8 +39,8 @@ public sealed class CatController : ArchiController {
/// Fetches URL of a random cat picture.
/// </summary>
[HttpGet]
[ProducesResponseType(typeof(GenericResponse<Uri>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.ServiceUnavailable)]
[ProducesResponseType<GenericResponse<Uri>>((int) HttpStatusCode.OK)]
[ProducesResponseType<GenericResponse>((int) HttpStatusCode.ServiceUnavailable)]
public async Task<ActionResult<GenericResponse>> CatGet() {
if (ASF.WebBrowser == null) {
throw new InvalidOperationException(nameof(ASF.WebBrowser));