From 0386a28b5a3c4212320e8a96ddd14c54b65a2090 Mon Sep 17 00:00:00 2001 From: Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 2 Aug 2021 19:06:44 +0200 Subject: Frodo swaggins (#126) * more swagger fun * document a whole bunch more stuff * more swagger yayyyyyyy * progress + go fmt --- internal/api/model/poll.go | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'internal/api/model/poll.go') diff --git a/internal/api/model/poll.go b/internal/api/model/poll.go index c6bffbe29..a925be8fd 100644 --- a/internal/api/model/poll.go +++ b/internal/api/model/poll.go @@ -51,19 +51,24 @@ type Poll struct { type PollOptions struct { // The text value of the poll option. String. Title string `json:"title"` - // The number of received votes for this option. Number, or null if results are not published yet. + // The number of received votes for this option. + // Number, or null if results are not published yet. VotesCount int `json:"votes_count,omitempty"` } -// PollRequest represents a mastodon-api poll attached to a status POST request, as defined here: https://docs.joinmastodon.org/methods/statuses/ -// It should be used at the path https://example.org/api/v1/statuses +// PollRequest models a request to create a poll. +// +// swagger:parameters createStatus type PollRequest struct { - // Array of possible answers. If provided, media_ids cannot be used, and poll[expires_in] must be provided. - Options []string `form:"options"` - // Duration the poll should be open, in seconds. If provided, media_ids cannot be used, and poll[options] must be provided. - ExpiresIn int `form:"expires_in"` - // Allow multiple choices? - Multiple bool `form:"multiple"` - // Hide vote counts until the poll ends? - HideTotals bool `form:"hide_totals"` + // Array of possible answers. + // If provided, media_ids cannot be used, and poll[expires_in] must be provided. + // name: poll[options] + Options []string `form:"options" json:"options" xml:"options"` + // Duration the poll should be open, in seconds. + // If provided, media_ids cannot be used, and poll[options] must be provided. + ExpiresIn int `form:"expires_in" json:"expires_in" xml:"expires_in"` + // Allow multiple choices on this poll. + Multiple bool `form:"multiple" json:"multiple" xml:"multiple"` + // Hide vote counts until the poll ends. + HideTotals bool `form:"hide_totals" json:"hide_totals" xml:"hide_totals"` } -- cgit v1.2.3