aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-05-13 10:34:04 +0000
committerlain <lain@soykaf.club>2020-05-13 10:34:04 +0000
commit6706cdce65f8b2dda55380dbfdad5e41e600af2d (patch)
treedae71c58f9a8e9b6e6540bc0c346064fdb68247d /lib
parent156c8a508846bd6d4e55f666c4ecc6f0129ac5fc (diff)
parentbcadbf964a56c071b2a3b5a5a95c419a467e5e1e (diff)
downloadpleroma-6706cdce65f8b2dda55380dbfdad5e41e600af2d.tar.gz
Merge branch 'openapi/suggestions' into 'develop'
Add OpenAPI spec for SuggestionController See merge request pleroma/pleroma!2525
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex b/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex
index c93a43969..f91df9ab7 100644
--- a/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex
@@ -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.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),