* 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

@ -28,13 +28,75 @@ import (
// AccountStatusesGETHandler serves the statuses of the requested account, if they're visible to the requester.
//
// Several different filters might be passed into this function in the query:
// swagger:operation GET /api/v1/accounts/{id}/statuses accountStatuses
//
// limit -- show only limit number of statuses
// exclude_replies -- exclude statuses that are a reply to another status
// max_id -- the maximum ID of the status to show
// pinned -- show only pinned statuses
// media_only -- show only statuses that have media attachments
// See statuses posted by the requested account.
//
// The statuses will be returned in descending chronological order (newest first), with sequential IDs (bigger = newer).
//
// ---
// tags:
// - accounts
//
// produces:
// - application/json
//
// parameters:
// - name: id
// type: string
// description: Account ID.
// in: path
// required: true
// - name: limit
// type: integer
// description: Number of statuses to return.
// default: 30
// in: query
// required: false
// - name: exclude_replies
// type: boolean
// description: Exclude statuses that are a reply to another status.
// default: false
// in: query
// required: false
// - name: max_id
// type: string
// description: |-
// Return only statuses *OLDER* than the given max status ID.
// The status with the specified ID will not be included in the response.
// in: query
// required: false
// - name: pinned_only
// type: boolean
// description: Show only pinned statuses. In other words,e xclude statuses that are not pinned to the given account ID.
// default: false
// in: query
// required: false
// - name: media_only
// type: boolean
// description: Show only statuses with media attachments.
// default: false
// in: query
// required: false
//
// security:
// - OAuth2 Bearer:
// - read:accounts
//
// responses:
// '200':
// name: statuses
// description: Array of statuses..
// schema:
// type: array
// items:
// "$ref": "#/definitions/status"
// '401':
// description: unauthorized
// '400':
// description: bad request
// '404':
// description: not found
func (m *Module) AccountStatusesGETHandler(c *gin.Context) {
l := m.log.WithField("func", "AccountStatusesGETHandler")