logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/
commit: d36d0abd276e0ec26d96f99e30ee0bbf331d204f
parent 49a5630c75b4eb9f9ec764dab0acc5e66c370609
Author: Phantasm <phantasm@centrum.cz>
Date:   Fri, 12 Dec 2025 21:17:58 +0100

API Docs: Switch some added 404 API response to ApiNotFoundError schema

Diffstat:

Mlib/pleroma/web/api_spec/operations/emoji_reaction_operation.ex2+-
Mlib/pleroma/web/api_spec/operations/report_operation.ex12++----------
Mlib/pleroma/web/api_spec/operations/status_operation.ex22+++-------------------
3 files changed, 6 insertions(+), 30 deletions(-)

diff --git a/lib/pleroma/web/api_spec/operations/emoji_reaction_operation.ex b/lib/pleroma/web/api_spec/operations/emoji_reaction_operation.ex @@ -37,7 +37,7 @@ defmodule Pleroma.Web.ApiSpec.EmojiReactionOperation do operationId: "EmojiReactionController.index", responses: %{ 200 => array_of_reactions_response(), - 404 => Operation.response("Access denied", "application/json", ApiError) + 404 => Operation.response("Access denied", "application/json", ApiNotFoundError) } } end diff --git a/lib/pleroma/web/api_spec/operations/report_operation.ex b/lib/pleroma/web/api_spec/operations/report_operation.ex @@ -7,6 +7,7 @@ defmodule Pleroma.Web.ApiSpec.ReportOperation do alias OpenApiSpex.Schema alias Pleroma.Web.ApiSpec.Helpers alias Pleroma.Web.ApiSpec.Schemas.ApiError + alias Pleroma.Web.ApiSpec.Schemas.ApiNotFoundError alias Pleroma.Web.ApiSpec.Schemas.BooleanLike def open_api_operation(action) do @@ -25,16 +26,7 @@ defmodule Pleroma.Web.ApiSpec.ReportOperation do responses: %{ 200 => Operation.response("Report", "application/json", create_response()), 400 => Operation.response("Report", "application/json", ApiError), - 404 => - Operation.response( - "Report", - "application/json", - %Schema{ - allOf: [ApiError], - title: "Report", - example: %{"error" => "Record not found"} - } - ) + 404 => Operation.response("Report", "application/json", ApiNotFoundError) } } end diff --git a/lib/pleroma/web/api_spec/operations/status_operation.ex b/lib/pleroma/web/api_spec/operations/status_operation.ex @@ -244,14 +244,7 @@ defmodule Pleroma.Web.ApiSpec.StatusOperation do "error" => "You have already pinned the maximum number of statuses" } }), - 404 => - Operation.response("Not found", "application/json", %Schema{ - allOf: [ApiError], - title: "Not Found", - example: %{ - "error" => "Record not found" - } - }), + 404 => Operation.response("Not found", "application/json", ApiNotFoundError), 422 => Operation.response( "Unprocessable Entity", @@ -341,7 +334,7 @@ defmodule Pleroma.Web.ApiSpec.StatusOperation do responses: %{ 200 => status_response(), 400 => Operation.response("Error", "application/json", ApiError), - 404 => Operation.response("Not found", "application/json", ApiError) + 404 => Operation.response("Not found", "application/json", ApiNotFoundError) } } end @@ -358,16 +351,7 @@ defmodule Pleroma.Web.ApiSpec.StatusOperation do responses: %{ 200 => status_response(), 400 => Operation.response("Error", "application/json", ApiError), - 404 => - Operation.response( - "Not Found", - "application/json", - %Schema{ - allOf: [ApiError], - title: "Error", - example: %{"error" => "Record not found"} - } - ) + 404 => Operation.response("Not Found", "application/json", ApiNotFoundError) } } end