From 58dddd86e0ddbb0c6aa54506dcef162321babfbb Mon Sep 17 00:00:00 2001 From: Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 31 Jul 2021 17:49:59 +0200 Subject: Swagger (#124) * start experimenting with swagger documentation * further adventures in swagger * do a few more api paths * account paths documented * go fmt * fix up some models * bit o lintin' --- internal/api/model/emoji.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'internal/api/model/emoji.go') diff --git a/internal/api/model/emoji.go b/internal/api/model/emoji.go index c2834718f..c1f81bf17 100644 --- a/internal/api/model/emoji.go +++ b/internal/api/model/emoji.go @@ -20,28 +20,32 @@ package model import "mime/multipart" -// Emoji represents a custom emoji. See https://docs.joinmastodon.org/entities/emoji/ +// Emoji represents a custom emoji. +// +// swagger:model emoji type Emoji struct { - // REQUIRED - // The name of the custom emoji. + // example: blobcat_uwu Shortcode string `json:"shortcode"` - // A link to the custom emoji. + // Web URL of the custom emoji. + // example: https://example.org/fileserver/emojis/blogcat_uwu.gif URL string `json:"url"` // A link to a static copy of the custom emoji. + // example: https://example.org/fileserver/emojis/blogcat_uwu.png StaticURL string `json:"static_url"` - // Whether this Emoji should be visible in the picker or unlisted. + // Emoji is visible in the emoji picker of the instance. + // example: true VisibleInPicker bool `json:"visible_in_picker"` - - // OPTIONAL - // Used for sorting custom emoji in the picker. + // example: blobcats Category string `json:"category,omitempty"` } // EmojiCreateRequest represents a request to create a custom emoji made through the admin API. +// swagger:model emojiCreateRequest type EmojiCreateRequest struct { // Desired shortcode for the emoji, without surrounding colons. This must be unique for the domain. + // example: blobcat_uwu Shortcode string `form:"shortcode" validation:"required"` // Image file to use for the emoji. Must be png or gif and no larger than 50kb. Image *multipart.FileHeader `form:"image" validation:"required"` -- cgit v1.2.3