diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2020-06-01 15:48:51 +0400 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2020-06-01 15:48:51 +0400 |
commit | a7627bdc7ae67a5c103f968eea02d6b1cf1ef8da (patch) | |
tree | e12af401307cfc3120d50c01580cd959f3b2503a /lib/pleroma/web/api_spec/helpers.ex | |
parent | decaa64f75f8bd69622fa5fba757f99719f09808 (diff) | |
parent | e96765df6b04fe5e9766271a9c62e559392758b2 (diff) | |
download | pleroma-a7627bdc7ae67a5c103f968eea02d6b1cf1ef8da.tar.gz |
Merge remote-tracking branch 'origin/develop' into global-status-expiration
Diffstat (limited to 'lib/pleroma/web/api_spec/helpers.ex')
-rw-r--r-- | lib/pleroma/web/api_spec/helpers.ex | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/pleroma/web/api_spec/helpers.ex b/lib/pleroma/web/api_spec/helpers.ex index 183df43ee..a9cfe0fed 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"] @@ -47,6 +48,15 @@ defmodule Pleroma.Web.ApiSpec.Helpers do ] end + def with_relationships_param do + Operation.parameter( + :with_relationships, + :query, + BooleanLike, + "Embed relationships into accounts." + ) + end + def empty_object_response do Operation.response("Empty object", "application/json", %Schema{type: :object, example: %{}}) end @@ -54,4 +64,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 |