summaryrefslogtreecommitdiff
path: root/internal/api/model/attachment.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-07-22 12:48:19 +0200
committerLibravatar GitHub <noreply@github.com>2022-07-22 12:48:19 +0200
commit73b8839c5d1b481d1aa1330cd8c206a9f2213333 (patch)
tree877525e40448effbc37d31fdc4f6cbef23263ee8 /internal/api/model/attachment.go
parent[bugfix] update go-cache library to fix critical bug during cache sweep sched... (diff)
downloadgotosocial-73b8839c5d1b481d1aa1330cd8c206a9f2213333.tar.xz
[bugfix] Make `/api/v2/media` more compatible with masto API (#724)
* update docs * make api version into a path param * update tests * workaround to unset URL if using v2 of api * make some fields into pointers
Diffstat (limited to 'internal/api/model/attachment.go')
-rw-r--r--internal/api/model/attachment.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/api/model/attachment.go b/internal/api/model/attachment.go
index 3ab29d2fb..aafa554d8 100644
--- a/internal/api/model/attachment.go
+++ b/internal/api/model/attachment.go
@@ -68,7 +68,7 @@ type Attachment struct {
Type string `json:"type"`
// The location of the original full-size attachment.
// example: https://example.org/fileserver/some_id/attachments/some_id/original/attachment.jpeg
- URL string `json:"url"`
+ URL *string `json:"url"`
// A shorter URL for the attachment.
// In our case, we just give the URL again since we don't create smaller URLs.
TextURL string `json:"text_url"`
@@ -78,16 +78,16 @@ type Attachment struct {
// The location of the full-size original attachment on the remote server.
// Only defined for instances other than our own.
// example: https://some-other-server.org/attachments/original/ahhhhh.jpeg
- RemoteURL string `json:"remote_url"`
+ RemoteURL *string `json:"remote_url"`
// The location of a scaled-down preview of the attachment on the remote server.
// Only defined for instances other than our own.
// example: https://some-other-server.org/attachments/small/ahhhhh.jpeg
- PreviewRemoteURL string `json:"preview_remote_url"`
+ PreviewRemoteURL *string `json:"preview_remote_url"`
// Metadata for this attachment.
Meta MediaMeta `json:"meta,omitempty"`
// Alt text that describes what is in the media attachment.
// example: This is a picture of a kitten.
- Description string `json:"description"`
+ Description *string `json:"description"`
// A hash computed by the BlurHash algorithm, for generating colorful preview thumbnails when media has not been downloaded yet.
// See https://github.com/woltapp/blurhash
Blurhash string `json:"blurhash,omitempty"`