1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
7 Contains stubs for unimplemented Mastodon API endpoints.
9 Note: instead of routing directly to this controller's action,
10 it's preferable to define an action in relevant (non-generic) controller,
11 set up OAuth rules for it and call this controller's function from it.
14 use Pleroma.Web, :controller
20 [Pleroma.Web.Plugs.OAuthScopesPlug, Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug]
21 when action in [:empty_array, :empty_object]
24 action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
26 def empty_array(conn, _) do
27 Logger.debug("Unimplemented, returning an empty array (list)")
31 def empty_object(conn, _) do
32 Logger.debug("Unimplemented, returning an empty object (map)")