From 312ce5a1bfbb9138615345bf305fba27f9ca5d22 Mon Sep 17 00:00:00 2001 From: Paul Dawson Date: Wed, 17 Jul 2024 20:50:22 -0500 Subject: [PATCH] Add short_description to mastodon v1 instance api response. Some third party client applications are expecting the short_description key in the v1 instance response. See this issue: https://github.com/Dimillian/IceCubesApp/issues/16 and this issue https://github.com/Dimillian/IceCubesApp/issues/2105#issuecomment-2231466416 short_description is a required field as per the masto api docs. https://docs.joinmastodon.org/entities/V1_Instance/#short_description --- lib/pleroma/web/mastodon_api/views/instance_view.ex | 1 + .../web/mastodon_api/controllers/instance_controller_test.exs | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/pleroma/web/mastodon_api/views/instance_view.ex b/lib/pleroma/web/mastodon_api/views/instance_view.ex index 2b5354873..c70306b78 100644 --- a/lib/pleroma/web/mastodon_api/views/instance_view.ex +++ b/lib/pleroma/web/mastodon_api/views/instance_view.ex @@ -17,6 +17,7 @@ def render("show.json", _) do uri: Pleroma.Web.Endpoint.url(), title: Keyword.get(instance, :name), description: Keyword.get(instance, :description), + short_description: Keyword.get(instance, :description), version: "#{@mastodon_api_level} (compatible; #{Pleroma.Application.named_version()})", email: Keyword.get(instance, :email), urls: %{ diff --git a/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs index 7b400d1ee..e8edfeb0f 100644 --- a/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs @@ -23,6 +23,7 @@ test "get instance information", %{conn: conn} do "uri" => _, "title" => _, "description" => _, + "short_description" => _, "version" => _, "email" => from_config_email, "urls" => %{