Improve OpenAPI errors

This commit is contained in:
Egor Kislitsyn 2020-04-17 19:27:22 +04:00
commit 163341857a
No known key found for this signature in database
GPG key ID: 1B49CB15B71E7805
2 changed files with 222 additions and 9 deletions

View file

@ -952,7 +952,16 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|> post("/api/v1/accounts", Map.delete(valid_params, attr))
|> json_response(400)
assert res == %{"error" => "Missing parameters"}
assert res == %{
"error" => "Missing field: #{attr}.",
"errors" => [
%{
"message" => "Missing field: #{attr}",
"source" => %{"pointer" => "/#{attr}"},
"title" => "Invalid value"
}
]
}
end)
end