Merge branch 'develop' into refactor/discoverable_user_field
[akkoma] / lib / pleroma / web / mastodon_api / controllers / suggestion_controller.ex
index c93a439696223e619263c03a94260988f4fd36c6..5765271cfa7cd6a5ee9c28c273d9b403eedb2f6d 100644 (file)
@@ -5,11 +5,26 @@
 defmodule Pleroma.Web.MastodonAPI.SuggestionController do
   use Pleroma.Web, :controller
 
-  alias Pleroma.Plugs.OAuthScopesPlug
-
   require Logger
 
-  plug(OAuthScopesPlug, %{scopes: ["read"]} when action == :index)
+  plug(Pleroma.Web.ApiSpec.CastAndValidate)
+  plug(Pleroma.Web.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),