analytics/lib/plausible_web/plugins/api/schemas/pagination_metadata.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

25 lines
599 B
Elixir

defmodule PlausibleWeb.Plugins.API.Schemas.PaginationMetadata do
@moduledoc """
Pagination metadata OpenAPI schema
"""
use PlausibleWeb, :open_api_schema
OpenApiSpex.schema(%{
title: "PaginationMetadata",
description: "Pagination meta data",
type: :object,
required: [:has_next_page, :has_prev_page],
properties: %{
has_next_page: %Schema{type: :boolean},
has_prev_page: %Schema{type: :boolean},
links: %Schema{
properties: %{
next: Schemas.Link,
prev: Schemas.Link
},
type: :object
}
}
})
end