diff options
author | Alex Gleason <alex@alexgleason.me> | 2021-08-05 09:43:24 -0500 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2021-08-05 11:11:24 -0500 |
commit | b83758bd9634d4f2fb70a92159072dd44e49bb31 (patch) | |
tree | 2452e8c4e1544fc9a0ad71292901b6cd52765566 /lib/pleroma/web/api_spec/operations/status_operation.ex | |
parent | 2b3d7794b23aac30cf8f977009d17b1abc602d19 (diff) | |
parent | 5f5dc24027ee5cfadd226c5db2e2a2bdb0ababe0 (diff) | |
download | pleroma-b83758bd9634d4f2fb70a92159072dd44e49bb31.tar.gz |
Merge remote-tracking branch 'pleroma/develop' into moderators
Diffstat (limited to 'lib/pleroma/web/api_spec/operations/status_operation.ex')
-rw-r--r-- | lib/pleroma/web/api_spec/operations/status_operation.ex | 48 |
1 files changed, 45 insertions, 3 deletions
diff --git a/lib/pleroma/web/api_spec/operations/status_operation.ex b/lib/pleroma/web/api_spec/operations/status_operation.ex index 40edc747d..802fbef3e 100644 --- a/lib/pleroma/web/api_spec/operations/status_operation.ex +++ b/lib/pleroma/web/api_spec/operations/status_operation.ex @@ -59,7 +59,7 @@ defmodule Pleroma.Web.ApiSpec.StatusOperation do Operation.response( "Status. When `scheduled_at` is present, ScheduledStatus is returned instead", "application/json", - %Schema{oneOf: [Status, ScheduledStatus]} + %Schema{anyOf: [Status, ScheduledStatus]} ), 422 => Operation.response("Bad Request / MRF Rejection", "application/json", ApiError) } @@ -182,7 +182,34 @@ defmodule Pleroma.Web.ApiSpec.StatusOperation do parameters: [id_param()], responses: %{ 200 => status_response(), - 400 => Operation.response("Error", "application/json", ApiError) + 400 => + Operation.response("Bad Request", "application/json", %Schema{ + allOf: [ApiError], + title: "Unprocessable Entity", + example: %{ + "error" => "You have already pinned the maximum number of statuses" + } + }), + 404 => + Operation.response("Not found", "application/json", %Schema{ + allOf: [ApiError], + title: "Unprocessable Entity", + example: %{ + "error" => "Record not found" + } + }), + 422 => + Operation.response( + "Unprocessable Entity", + "application/json", + %Schema{ + allOf: [ApiError], + title: "Unprocessable Entity", + example: %{ + "error" => "Someone else's status cannot be pinned" + } + } + ) } } end @@ -197,7 +224,22 @@ defmodule Pleroma.Web.ApiSpec.StatusOperation do parameters: [id_param()], responses: %{ 200 => status_response(), - 400 => Operation.response("Error", "application/json", ApiError) + 400 => + Operation.response("Bad Request", "application/json", %Schema{ + allOf: [ApiError], + title: "Unprocessable Entity", + example: %{ + "error" => "You have already pinned the maximum number of statuses" + } + }), + 404 => + Operation.response("Not found", "application/json", %Schema{ + allOf: [ApiError], + title: "Unprocessable Entity", + example: %{ + "error" => "Record not found" + } + }) } } end |