Use json_response_and_validate_schema/2 in tests to validate OpenAPI schema

This commit is contained in:
Egor Kislitsyn 2020-04-27 20:46:52 +04:00
commit 2efc00b3cf
No known key found for this signature in database
GPG key ID: 1B49CB15B71E7805
7 changed files with 330 additions and 358 deletions

View file

@ -26,6 +26,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
alias Pleroma.Web.OAuth.Token
alias Pleroma.Web.TwitterAPI.TwitterAPI
plug(OpenApiSpex.Plug.CastAndValidate, render_error: Pleroma.Web.ApiSpec.RenderError)
plug(:skip_plug, OAuthScopesPlug when action == :identity_proofs)
plug(
@ -83,8 +85,6 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
plug(RateLimiter, [name: :app_account_creation] when action == :create)
plug(:assign_account_by_id when action in @needs_account)
plug(OpenApiSpex.Plug.CastAndValidate, render_error: Pleroma.Web.ApiSpec.RenderError)
action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.AccountOperation