diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2021-08-10 20:33:00 +0200 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2021-08-10 20:33:00 +0200 |
commit | 197cdebca936fd01175476036f1230167bf353bc (patch) | |
tree | 4b06b142d68c6e857b1ad51d734ed82718f3bf65 /lib/pleroma/web/api_spec | |
parent | 09dcb2b5227d797363d350f4e9ee2f54e1e31af2 (diff) | |
download | pleroma-197cdebca936fd01175476036f1230167bf353bc.tar.gz |
TwitterAPI: Make change_email require body params instead of query
Diffstat (limited to 'lib/pleroma/web/api_spec')
-rw-r--r-- | lib/pleroma/web/api_spec/operations/twitter_util_operation.ex | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/pleroma/web/api_spec/operations/twitter_util_operation.ex b/lib/pleroma/web/api_spec/operations/twitter_util_operation.ex index bc54f1915..879b2227e 100644 --- a/lib/pleroma/web/api_spec/operations/twitter_util_operation.ex +++ b/lib/pleroma/web/api_spec/operations/twitter_util_operation.ex @@ -101,11 +101,7 @@ defmodule Pleroma.Web.ApiSpec.TwitterUtilOperation do summary: "Change account email", security: [%{"oAuth" => ["write:accounts"]}], operationId: "UtilController.change_email", - parameters: [ - Operation.parameter(:password, :query, :string, "Current password", required: true), - Operation.parameter(:email, :query, :string, "New email", required: true) - ], - requestBody: nil, + requestBody: request_body("Parameters", change_email_request(), required: true), responses: %{ 200 => Operation.response("Success", "application/json", %Schema{ @@ -118,6 +114,19 @@ defmodule Pleroma.Web.ApiSpec.TwitterUtilOperation do } end + defp change_email_request do + %Schema{ + title: "ChangeEmailRequest", + description: "POST body for changing the account's email", + type: :object, + required: [:email, :password], + properties: %{ + email: %Schema{type: :string, description: "New email"}, + password: %Schema{type: :string, description: "Current password"} + } + } + end + def update_notificaton_settings_operation do %Operation{ tags: ["Accounts"], |