MastoAPI: Add `GET /api/v1/accounts/lookup`
[akkoma] / lib / pleroma / web / api_spec / operations / account_operation.ex
index 54e5ebc76e2ae943e02b3026d85799f7cf511641..5836cab50dcaca2b44759357699a7316094ff8ce 100644 (file)
@@ -371,6 +371,26 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
     }
   end
 
+  def lookup_operation do
+    %Operation{
+      tags: ["Account lookup"],
+      summary: "Find a user by nickname",
+      operationId: "AccountController.lookup",
+      parameters: [
+        Operation.parameter(
+          :acct,
+          :query,
+          :string,
+          "User nickname"
+        )
+      ],
+      responses: %{
+        200 => Operation.response("Account", "application/json", Account),
+        404 => Operation.response("Error", "application/json", ApiError)
+      }
+    }
+  end
+
   def endorsements_operation do
     %Operation{
       tags: ["Retrieve account information"],