Skip to content

Commit

Permalink
[docs] Swagger document /api/v1/custom_emojis (#824)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmethurst authored Sep 13, 2022
1 parent 2b34a9b commit 6a10123
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
25 changes: 25 additions & 0 deletions docs/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3128,6 +3128,30 @@ paths:
summary: Get an array of accounts that requesting account has blocked.
tags:
- blocks
/api/v1/custom_emojis:
get:
operationId: customEmojisGet
produces:
- application/json
responses:
"200":
description: Array of custom emojis.
schema:
items:
$ref: '#/definitions/emoji'
type: array
"401":
description: unauthorized
"406":
description: not acceptable
"500":
description: internal server error
security:
- OAuth2 Bearer:
- read:custom_emojis
summary: Get an array of custom emojis available on the instance.
tags:
- custom_emojis
/api/v1/follow_requests:
get:
description: |-
Expand Down Expand Up @@ -4451,6 +4475,7 @@ securityDefinitions:
read: grants read access to everything
read:accounts: grants read access to accounts
read:blocks: grant read access to blocks
read:custom_emojis: grant read access to custom_emojis
read:media: grant read access to media
read:notifications: grants read access to notifications
read:search: grant read access to searches
Expand Down
1 change: 1 addition & 0 deletions docs/swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
// read: grants read access to everything
// read:accounts: grants read access to accounts
// read:blocks: grant read access to blocks
// read:custom_emojis: grant read access to custom_emojis
// read:media: grant read access to media
// read:search: grant read access to searches
// read:statuses: grants read access to statuses
Expand Down
29 changes: 28 additions & 1 deletion internal/api/client/emoji/emojisget.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,34 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/oauth"
)

// EmojisGETHandler returns a list of custom emojis enabled on the instance
// EmojisGETHandler swagger:operation GET /api/v1/custom_emojis customEmojisGet
//
// Get an array of custom emojis available on the instance.
//
// ---
// tags:
// - custom_emojis
//
// produces:
// - application/json
//
// security:
// - OAuth2 Bearer:
// - read:custom_emojis
//
// responses:
// '200':
// description: Array of custom emojis.
// schema:
// type: array
// items:
// "$ref": "#/definitions/emoji"
// '401':
// description: unauthorized
// '406':
// description: not acceptable
// '500':
// description: internal server error
func (m *Module) EmojisGETHandler(c *gin.Context) {
if _, err := oauth.Authed(c, true, true, true, true); err != nil {
api.ErrorHandler(c, gtserror.NewErrorUnauthorized(err, err.Error()), m.processor.InstanceGet)
Expand Down

0 comments on commit 6a10123

Please sign in to comment.