* 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'
This commit is contained in:
Tobi Smethurst 2021-07-31 17:49:59 +02:00 committed by GitHub
commit 58dddd86e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 2355 additions and 169 deletions

View file

@ -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"`