From 1053544ddca6f8ea3e6b74a447c784b5ed628558 Mon Sep 17 00:00:00 2001 From: Ryan Fox Date: Wed, 23 Mar 2022 17:02:31 -0700 Subject: [PATCH] Make more fields optional This fixes GoToSocial compatibility. --- src/Mastodon/Decoder.elm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Mastodon/Decoder.elm b/src/Mastodon/Decoder.elm index 0c271b7..bc4c615 100644 --- a/src/Mastodon/Decoder.elm +++ b/src/Mastodon/Decoder.elm @@ -153,7 +153,7 @@ attachmentDecoder = |> Pipe.required "url" Decode.string |> Pipe.optional "remote_url" Decode.string "" |> Pipe.optional "preview_url" Decode.string "" - |> Pipe.required "text_url" (Decode.nullable Decode.string) + |> Pipe.optional "text_url" (Decode.nullable Decode.string) Nothing contextDecoder : Decode.Decoder Context @@ -299,8 +299,8 @@ statusDecoder = |> Pipe.optional "favourited" (Decode.nullable Decode.bool) Nothing |> Pipe.required "favourites_count" Decode.int |> Pipe.required "id" statusIdDecoder - |> Pipe.required "in_reply_to_account_id" (Decode.nullable idDecoder) - |> Pipe.required "in_reply_to_id" (Decode.nullable statusIdDecoder) + |> Pipe.optional "in_reply_to_account_id" (Decode.nullable idDecoder) Nothing + |> Pipe.optional "in_reply_to_id" (Decode.nullable statusIdDecoder) Nothing |> Pipe.required "media_attachments" (Decode.list attachmentDecoder) |> Pipe.required "mentions" (Decode.list mentionDecoder) |> Pipe.optional "quote" (Decode.lazy (\_ -> Decode.nullable quoteDecoder)) Nothing