analytics/lib/plausible_web/plugins/api/schemas/unauthorized.ex
hq1 38b1834b3f
Tidy up openapi schema (#3498)
* Tidy up OpenAPI schema

* Remove `items` from object schema
2023-11-08 11:51:37 +01:00

23 lines
490 B
Elixir

defmodule PlausibleWeb.Plugins.API.Schemas.Unauthorized do
@moduledoc """
OpenAPI schema for a generic 401 response
"""
use PlausibleWeb, :open_api_schema
OpenApiSpex.schema(%{
description: """
The response that is returned when the user makes an unauthorized request.
""",
type: :object,
title: "UnauthorizedError",
required: [:errors],
properties: %{
errors: %Schema{
items: Schemas.Error,
type: :array
}
}
})
end