diff options
author | 2021-07-31 17:49:59 +0200 | |
---|---|---|
committer | 2021-07-31 17:49:59 +0200 | |
commit | 58dddd86e0ddbb0c6aa54506dcef162321babfbb (patch) | |
tree | ee83cec11f05dfe1e397b9303fe5cd7c2273d4f3 /internal/api/model/poll.go | |
parent | Password change (#123) (diff) | |
download | gotosocial-58dddd86e0ddbb0c6aa54506dcef162321babfbb.tar.xz |
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'
Diffstat (limited to 'internal/api/model/poll.go')
-rw-r--r-- | internal/api/model/poll.go | 11 |
1 files changed, 8 insertions, 3 deletions
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"` |