diff options
author | rinpatch <rinpatch@sdf.org> | 2020-04-28 11:57:16 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-04-28 11:57:16 +0000 |
commit | 12bb7fc0dc94068d8337f10fc337ab23c8c7e77e (patch) | |
tree | db22ab2a17bad9edc35734596b098a8bd3f0195b /lib/pleroma/web/api_spec/helpers.ex | |
parent | 9994768312ede572c4ddd6beda7027b0a2baddce (diff) | |
parent | dda65f7799e9dfa2e7b87389848eeee10993a858 (diff) | |
download | pleroma-12bb7fc0dc94068d8337f10fc337ab23c8c7e77e.tar.gz |
Merge branch 'openapi/account' into 'develop'
Add OpenAPI specs for AccountController
See merge request pleroma/pleroma!2374
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 |