diff options
author | Roman Chvanikov <chvanikoff@pm.me> | 2020-04-29 17:03:17 +0300 |
---|---|---|
committer | Roman Chvanikov <chvanikoff@pm.me> | 2020-04-29 17:03:17 +0300 |
commit | 7ef37ed99db69d8553e638e88527ded475f54a5f (patch) | |
tree | e2a6bae013f29ca7d6a8dfb69be1aa13d0a6b5af /lib/pleroma/web/api_spec/helpers.ex | |
parent | 37998e43636265d7709dbbf4926b07b7f94e04ea (diff) | |
parent | 58fded9858edbeb318dc011cb313e82a86fbafcb (diff) | |
download | pleroma-7ef37ed99db69d8553e638e88527ded475f54a5f.tar.gz |
merge develop
Diffstat (limited to 'lib/pleroma/web/api_spec/helpers.ex')
-rw-r--r-- | lib/pleroma/web/api_spec/helpers.ex | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/pleroma/web/api_spec/helpers.ex b/lib/pleroma/web/api_spec/helpers.ex index 7348dcbee..ce40fb9e8 100644 --- a/lib/pleroma/web/api_spec/helpers.ex +++ b/lib/pleroma/web/api_spec/helpers.ex @@ -3,6 +3,9 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ApiSpec.Helpers do + alias OpenApiSpex.Operation + alias OpenApiSpex.Schema + def request_body(description, schema_ref, opts \\ []) do media_types = ["application/json", "multipart/form-data", "application/x-www-form-urlencoded"] @@ -24,4 +27,23 @@ defmodule Pleroma.Web.ApiSpec.Helpers do required: opts[:required] || false } end + + def pagination_params do + [ + Operation.parameter(:max_id, :query, :string, "Return items older than this ID"), + Operation.parameter(:min_id, :query, :string, "Return the oldest items newer than this ID"), + Operation.parameter( + :since_id, + :query, + :string, + "Return the newest items newer than this ID" + ), + Operation.parameter( + :limit, + :query, + %Schema{type: :integer, default: 20, maximum: 40}, + "Limit" + ) + ] + end end |