diff options
author | Roman Chvanikov <chvanikoff@pm.me> | 2020-05-18 11:56:27 +0300 |
---|---|---|
committer | Roman Chvanikov <chvanikoff@pm.me> | 2020-05-18 11:56:27 +0300 |
commit | 01bd6a1e54c8734e8965f153a9406cecc07950f3 (patch) | |
tree | 791348626f54b390167693da8c1a6481c54d78de /lib/pleroma/web/api_spec/helpers.ex | |
parent | 8a383707ae143ba47fa1ba68da20bc6bec425126 (diff) | |
parent | 1199cf3a788334cd3fdb968d9f736e43c1401da1 (diff) | |
download | pleroma-01bd6a1e54c8734e8965f153a9406cecc07950f3.tar.gz |
Merge branch 'develop' into feature/admin-api-status-count-per-instance
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 |