diff options
author | crupest <crupest@outlook.com> | 2020-08-23 18:15:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-23 18:15:25 +0800 |
commit | 07795ebbd2b2a48ab0cebe97b6d591d35ef0cd31 (patch) | |
tree | 321cf420480047bead290a6fea4c2433ea69b941 /Timeline/Controllers | |
parent | 733b8291855d1498e0ba9bc36a47a1b5f8b612ad (diff) | |
parent | 5a821a3e81dfc14c15c70d90e9266d3a163479a9 (diff) | |
download | timeline-07795ebbd2b2a48ab0cebe97b6d591d35ef0cd31.tar.gz timeline-07795ebbd2b2a48ab0cebe97b6d591d35ef0cd31.tar.bz2 timeline-07795ebbd2b2a48ab0cebe97b6d591d35ef0cd31.zip |
Merge pull request #150 from crupest/swagger
Enhance swagger docs.
Diffstat (limited to 'Timeline/Controllers')
-rw-r--r-- | Timeline/Controllers/TimelineController.cs | 3 | ||||
-rw-r--r-- | Timeline/Controllers/UserAvatarController.cs | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Timeline/Controllers/TimelineController.cs b/Timeline/Controllers/TimelineController.cs index 43178ac6..90b50bbb 100644 --- a/Timeline/Controllers/TimelineController.cs +++ b/Timeline/Controllers/TimelineController.cs @@ -199,7 +199,8 @@ namespace Timeline.Controllers /// <param name="ifNoneMatch">If-None-Match header.</param>
/// <returns>The data.</returns>
[HttpGet("timelines/{name}/posts/{id}/data")]
- [ProducesResponseType(StatusCodes.Status200OK)]
+ [Produces("image/png", "image/jpeg", "image/gif", "image/webp", "application/json", "text/json")]
+ [ProducesResponseType(typeof(byte[]), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(void), StatusCodes.Status304NotModified)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
diff --git a/Timeline/Controllers/UserAvatarController.cs b/Timeline/Controllers/UserAvatarController.cs index 32f63fc6..97c4bdb8 100644 --- a/Timeline/Controllers/UserAvatarController.cs +++ b/Timeline/Controllers/UserAvatarController.cs @@ -3,7 +3,6 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
-using System.IO;
using System.Threading.Tasks;
using Timeline.Auth;
using Timeline.Filters;
@@ -46,6 +45,7 @@ namespace Timeline.Controllers /// <param name="ifNoneMatch">If-None-Match header.</param>
/// <returns>Avatar data.</returns>
[HttpGet("users/{username}/avatar")]
+ [Produces("image/png", "image/jpeg", "image/gif", "image/webp", "application/json", "text/json")]
[ProducesResponseType(typeof(byte[]), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(void), StatusCodes.Status304NotModified)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
|