X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fapi_spec%2Foperations%2Fadmin%2Fmedia_proxy_cache_operation.ex;h=e16356a479fe14fb467b0da9b0ebd3f24ffc835a;hb=44a86951a339fdb0146a237ca5178c83823629c7;hp=20d033f66f9f88c4863c72af71d3c133e9f2a045;hpb=b2ba70eec437e81b8c1c2be3081858be38a73c61;p=akkoma
diff --git a/lib/pleroma/web/api_spec/operations/admin/media_proxy_cache_operation.ex b/lib/pleroma/web/api_spec/operations/admin/media_proxy_cache_operation.ex
index 20d033f66..e16356a47 100644
--- a/lib/pleroma/web/api_spec/operations/admin/media_proxy_cache_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/admin/media_proxy_cache_operation.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ApiSpec.Admin.MediaProxyCacheOperation do
@@ -21,6 +21,12 @@ defmodule Pleroma.Web.ApiSpec.Admin.MediaProxyCacheOperation do
operationId: "AdminAPI.MediaProxyCacheController.index",
security: [%{"oAuth" => ["read:media_proxy_caches"]}],
parameters: [
+ Operation.parameter(
+ :query,
+ :query,
+ %Schema{type: :string, default: nil},
+ "Page"
+ ),
Operation.parameter(
:page,
:query,
@@ -36,7 +42,26 @@ defmodule Pleroma.Web.ApiSpec.Admin.MediaProxyCacheOperation do
| admin_api_params()
],
responses: %{
- 200 => success_response()
+ 200 =>
+ Operation.response(
+ "Array of banned MediaProxy URLs in Cachex",
+ "application/json",
+ %Schema{
+ type: :object,
+ properties: %{
+ count: %Schema{type: :integer},
+ page_size: %Schema{type: :integer},
+ urls: %Schema{
+ type: :array,
+ items: %Schema{
+ type: :string,
+ format: :uri,
+ description: "MediaProxy URLs"
+ }
+ }
+ }
+ }
+ )
}
}
end
@@ -61,7 +86,7 @@ defmodule Pleroma.Web.ApiSpec.Admin.MediaProxyCacheOperation do
required: true
),
responses: %{
- 200 => success_response(),
+ 200 => empty_object_response(),
400 => Operation.response("Error", "application/json", ApiError)
}
}
@@ -88,25 +113,9 @@ defmodule Pleroma.Web.ApiSpec.Admin.MediaProxyCacheOperation do
required: true
),
responses: %{
- 200 => success_response(),
+ 200 => empty_object_response(),
400 => Operation.response("Error", "application/json", ApiError)
}
}
end
-
- defp success_response do
- Operation.response("Array of banned MediaProxy URLs in Cachex", "application/json", %Schema{
- type: :object,
- properties: %{
- urls: %Schema{
- type: :array,
- items: %Schema{
- type: :string,
- format: :uri,
- description: "MediaProxy URLs"
- }
- }
- }
- })
- end
end