mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix/docs] Poll api fixups + swagger docs (#2345)
This commit is contained in:
@ -41,10 +41,15 @@ type Poll struct {
|
||||
VotersCount int `json:"voters_count"`
|
||||
|
||||
// When called with a user token, has the authorized user voted?
|
||||
Voted bool `json:"voted,omitempty"`
|
||||
//
|
||||
// Omitted when no user token provided.
|
||||
Voted *bool `json:"voted,omitempty"`
|
||||
|
||||
// When called with a user token, which options has the authorized user chosen? Contains an array of index values for options.
|
||||
OwnVotes []int `json:"own_votes,omitempty"`
|
||||
// When called with a user token, which options has the authorized
|
||||
// user chosen? Contains an array of index values for options.
|
||||
//
|
||||
// Omitted when no user token provided.
|
||||
OwnVotes *[]int `json:"own_votes,omitempty"`
|
||||
|
||||
// Possible answers for the poll.
|
||||
Options []PollOption `json:"options"`
|
||||
@ -66,7 +71,7 @@ type PollOption struct {
|
||||
|
||||
// PollRequest models a request to create a poll.
|
||||
//
|
||||
// swagger:parameters createStatus
|
||||
// swagger:model pollRequest
|
||||
type PollRequest struct {
|
||||
// Array of possible answers.
|
||||
// If provided, media_ids cannot be used, and poll[expires_in] must be provided.
|
||||
@ -86,7 +91,7 @@ type PollRequest struct {
|
||||
|
||||
// PollVoteRequest models a request to vote in a poll.
|
||||
//
|
||||
// swagger:parameters pollVote
|
||||
// swagger:ignore
|
||||
type PollVoteRequest struct {
|
||||
// Choices contains poll vote choice indices. Note that form
|
||||
// uses a different key than the JSON, i.e. the '[]' suffix.
|
||||
|
@ -155,7 +155,7 @@ type StatusCreateRequest struct {
|
||||
// in: formData
|
||||
MediaIDs []string `form:"media_ids[]" json:"media_ids" xml:"media_ids"`
|
||||
// Poll to include with this status.
|
||||
// swagger:ignore
|
||||
// in: formData
|
||||
Poll *PollRequest `form:"poll" json:"poll" xml:"poll"`
|
||||
// ID of the status being replied to, if status is a reply.
|
||||
// in: formData
|
||||
|
Reference in New Issue
Block a user