diff options
author | Alex Gleason <alex@alexgleason.me> | 2021-05-16 13:22:26 -0500 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2021-05-16 13:22:26 -0500 |
commit | 7ac4da8dd4471455c7d243983d0e1ca6fa32a14e (patch) | |
tree | e0bf3be13a4e23ae5e16d08d08287b26fea3e0b3 /lib/pleroma/web/api_spec/operations/status_operation.ex | |
parent | 230ad82dadf013cb56909d1e8df2a2d652c47068 (diff) | |
parent | 745375bdcf2679ff803dd4ebc4a8313a7b5fb157 (diff) | |
download | pleroma-7ac4da8dd4471455c7d243983d0e1ca6fa32a14e.tar.gz |
Merge remote-tracking branch 'pleroma/develop' into gitignore-runtime-exs
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 |