Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

615 B
Raw Blame
defmodule PlausibleWeb.Plugins.API.Schemas.Goal.CustomProps do
  @moduledoc """
  Reusable OpenAPI schema definitions for Custom Properties in Goals
  """

  alias OpenApiSpex.Schema

  def response_schema do
    %Schema{
      type: :object,
      description: "Custom properties (string keys and values)",
      additionalProperties: %Schema{type: :string},
      readOnly: true
    }
  end

  def request_schema do
    %Schema{
      type: :object,
      description: "Custom properties (max 3, string keys and values)",
      additionalProperties: %Schema{type: :string},
      maxProperties: 3
    }
  end
end