From ce8146cf60f68b20e3bc4bf64fb723a192bf8f40 Mon Sep 17 00:00:00 2001 From: David Whetstone Date: Wed, 19 Jun 2024 01:45:48 -0700 Subject: [PATCH] Mark MediaAttachment.preview_url, blurhash as nullable (#1457) * Mark MediaAttachment.preview_url as nullable Had a payload in the wild where preview_url was `null` and the method that generates this value can certainly return `nil` if none of its conditions are met: https://github.com/mastodon/mastodon/blob/d326ad0ed9a2e874213c9313f25b973638e4b94d/app/serializers/rest/media_attachment_serializer.rb#L30-L38 Also both TootSDK and IceCubesApp have this property as nullable. * Mark MediaAttachment.blurhash as nullable When the attachment has type `audio`, `blurhash` is `null`. --- content/en/entities/MediaAttachment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/entities/MediaAttachment.md b/content/en/entities/MediaAttachment.md index 51e3205e..525e4b65 100644 --- a/content/en/entities/MediaAttachment.md +++ b/content/en/entities/MediaAttachment.md @@ -186,7 +186,7 @@ aliases: [ ### `preview_url` {#preview_url} **Description:** The location of a scaled-down preview of the attachment.\ -**Type:** String (URL)\ +**Type:** {{}} String (URL)\ **Version history:**\ 0.6.0 - added @@ -219,7 +219,7 @@ More importantly, there may be another topl-level `focus` Hash object on images ### `blurhash` {#blurhash} **Description:** A hash computed by [the BlurHash algorithm](https://github.com/woltapp/blurhash), for generating colorful preview thumbnails when media has not been downloaded yet.\ -**Type:** String (Blurhash)\ +**Type:** {{}} String (Blurhash)\ **Version history:**\ 2.8.1 - added