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/poll.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'internal/api/model/poll.go') diff --git a/internal/api/model/poll.go b/internal/api/model/poll.go index b00e7680a..c6bffbe29 100644 --- a/internal/api/model/poll.go +++ b/internal/api/model/poll.go @@ -18,12 +18,15 @@ package model -// Poll represents the mastodon-api poll type, as described here: https://docs.joinmastodon.org/entities/poll/ +// Poll represents a poll attached to a status. +// +// swagger:model poll type Poll struct { // The ID of the poll in the database. + // example: 01FBYKMD1KBMJ0W6JF1YZ3VY5D ID string `json:"id"` // When the poll ends. (ISO 8601 Datetime), or null if the poll does not end - ExpiresAt string `json:"expires_at"` + ExpiresAt string `json:"expires_at,omitempty"` // Is the poll currently expired? Expired bool `json:"expired"` // Does the poll allow multiple-choice answers? @@ -42,7 +45,9 @@ type Poll struct { Emojis []Emoji `json:"emojis"` } -// PollOptions represents the current vote counts for different poll options +// PollOptions represents the current vote counts for different poll options. +// +// swagger:model pollOptions type PollOptions struct { // The text value of the poll option. String. Title string `json:"title"` -- cgit v1.2.3