Merge branch 'develop' into 'remove-twitter-api'
[akkoma] / lib / pleroma / web / mastodon_api / controllers / suggestion_controller.ex
index 0cdc7bd8d9e1316b66ccbdfe3925be03dcc879ad..f91df9ab709034e74ff1cafe7c9d7bdfa8486f68 100644 (file)
@@ -7,8 +7,26 @@ defmodule Pleroma.Web.MastodonAPI.SuggestionController do
 
   require Logger
 
-  @doc "GET /api/v1/suggestions"
-  def index(conn, _) do
-    json(conn, [])
+  plug(Pleroma.Web.ApiSpec.CastAndValidate)
+  plug(Pleroma.Plugs.OAuthScopesPlug, %{scopes: ["read"]} when action == :index)
+
+  def open_api_operation(action) do
+    operation = String.to_existing_atom("#{action}_operation")
+    apply(__MODULE__, operation, [])
+  end
+
+  def index_operation do
+    %OpenApiSpex.Operation{
+      tags: ["Suggestions"],
+      summary: "Follow suggestions (Not implemented)",
+      operationId: "SuggestionController.index",
+      responses: %{
+        200 => Pleroma.Web.ApiSpec.Helpers.empty_array_response()
+      }
+    }
   end
+
+  @doc "GET /api/v1/suggestions"
+  def index(conn, params),
+    do: Pleroma.Web.MastodonAPI.MastodonAPIController.empty_array(conn, params)
 end