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/card.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/card.go')
-rw-r--r-- | internal/api/model/card.go | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/internal/api/model/card.go b/internal/api/model/card.go index ffa6d53e5..46807a735 100644 --- a/internal/api/model/card.go +++ b/internal/api/model/card.go @@ -18,15 +18,18 @@ package model -// Card represents a rich preview card that is generated using OpenGraph tags from a URL. See here: https://docs.joinmastodon.org/entities/card/ +// Card represents a rich preview card that is generated using OpenGraph tags from a URL. +// +// swagger:model card type Card struct { - // REQUIRED - // Location of linked resource. + // example: https://buzzfeed.com/some/fuckin/buzzfeed/article URL string `json:"url"` // Title of linked resource. + // example: Buzzfeed - Is Water Wet? Title string `json:"title"` // Description of preview. + // example: Is water wet? We're not sure. In this article, we ask an expert... Description string `json:"description"` // The type of the preview card. // String (Enumerable, oneOf) @@ -34,17 +37,19 @@ type Card struct { // photo = Photo OEmbed // video = Video OEmbed // rich = iframe OEmbed. Not currently accepted, so won't show up in practice. + // example: link Type string `json:"type"` - - // OPTIONAL - // The author of the original resource. + // example: weewee@buzzfeed.com AuthorName string `json:"author_name"` // A link to the author of the original resource. + // example: https://buzzfeed.com/authors/weewee AuthorURL string `json:"author_url"` // The provider of the original resource. + // example: Buzzfeed ProviderName string `json:"provider_name"` // A link to the provider of the original resource. + // example: https://buzzfeed.com ProviderURL string `json:"provider_url"` // HTML to be used for generating the preview card. HTML string `json:"html"` @@ -53,6 +58,7 @@ type Card struct { // Height of preview, in pixels. Height int `json:"height"` // Preview thumbnail. + // example: https://example.org/fileserver/preview/thumb.jpg Image string `json:"image"` // Used for photo embeds, instead of custom html. EmbedURL string `json:"embed_url"` |