X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fapi_spec%2Fhelpers.ex;h=a258e8421c6e6877145ba85e76bec2e0094bd629;hb=0883a706dc376fdfb7de9df1366803e87c8e7c98;hp=ee077a3f9e79b103ed2225f8a847bedb4639ca21;hpb=fd2fb2bb2e2292997fbe6f70c4d12b50c56cfab9;p=akkoma diff --git a/lib/pleroma/web/api_spec/helpers.ex b/lib/pleroma/web/api_spec/helpers.ex index ee077a3f9..a258e8421 100644 --- a/lib/pleroma/web/api_spec/helpers.ex +++ b/lib/pleroma/web/api_spec/helpers.ex @@ -5,6 +5,7 @@ defmodule Pleroma.Web.ApiSpec.Helpers do alias OpenApiSpex.Operation alias OpenApiSpex.Schema + alias Pleroma.Web.ApiSpec.Schemas.BooleanLike def request_body(description, schema_ref, opts \\ []) do media_types = ["application/json", "multipart/form-data", "application/x-www-form-urlencoded"] @@ -38,6 +39,12 @@ defmodule Pleroma.Web.ApiSpec.Helpers do :string, "Return the newest items newer than this ID" ), + Operation.parameter( + :offset, + :query, + %Schema{type: :integer, default: 0}, + "Return items past this number of items" + ), Operation.parameter( :limit, :query, @@ -47,12 +54,12 @@ defmodule Pleroma.Web.ApiSpec.Helpers do ] end - def embed_relationships_param do + def with_relationships_param do Operation.parameter( - :embed_relationships, + :with_relationships, :query, - :boolean, - "Embed relationships into accounts (Pleroma extension)" + BooleanLike, + "Embed relationships into accounts." ) end @@ -63,4 +70,8 @@ defmodule Pleroma.Web.ApiSpec.Helpers do def empty_array_response do Operation.response("Empty array", "application/json", %Schema{type: :array, example: []}) end + + def no_content_response do + Operation.response("No Content", "application/json", %Schema{type: :string, example: ""}) + end end