Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into chat-federation...
[akkoma] / lib / pleroma / web / api_spec / operations / pleroma_notification_operation.ex
index 636c39a15ae4c9b02e0347c45d233f404cd8e1a7..b0c8db863acc4feadced1250148247d88ebf3031 100644 (file)
@@ -8,6 +8,8 @@ defmodule Pleroma.Web.ApiSpec.PleromaNotificationOperation do
   alias Pleroma.Web.ApiSpec.NotificationOperation
   alias Pleroma.Web.ApiSpec.Schemas.ApiError
 
+  import Pleroma.Web.ApiSpec.Helpers
+
   def open_api_operation(action) do
     operation = String.to_existing_atom("#{action}_operation")
     apply(__MODULE__, operation, [])
@@ -17,10 +19,14 @@ defmodule Pleroma.Web.ApiSpec.PleromaNotificationOperation do
     %Operation{
       tags: ["Notifications"],
       summary: "Mark notifications as read. Query parameters are mutually exclusive.",
-      parameters: [
-        Operation.parameter(:id, :query, :string, "A single notification ID to read"),
-        Operation.parameter(:max_id, :query, :string, "Read all notifications up to this id")
-      ],
+      requestBody:
+        request_body("Parameters", %Schema{
+          type: :object,
+          properties: %{
+            id: %Schema{type: :integer, description: "A single notification ID to read"},
+            max_id: %Schema{type: :integer, description: "Read all notifications up to this ID"}
+          }
+        }),
       security: [%{"oAuth" => ["write:notifications"]}],
       operationId: "PleromaAPI.NotificationController.mark_as_read",
       responses: %{