analytics/lib/plausible_web/plugins/api/schemas/custom_prop.ex
hq1 615b6aef7d
Plugins API exentsions (custom props, bulk goal delete, goal creation => ListResponse always) (#3593)
* End polymorphic response in goals create

Being part of the v3 spec, this isn't well
(or at all) supported by OpenAPI generators.

Always respond with `Goal.ListResponse`

* Implement `PUT /custom_props`

* Implement bulk `DELETE /goals`

* Expose API for (bulk-)disabling custom props

* Add controller typespecs

* Delegate list wrapping to `Plausible.API.*`
2023-12-06 12:33:33 +01:00

28 lines
586 B
Elixir

defmodule PlausibleWeb.Plugins.API.Schemas.CustomProp do
@moduledoc """
OpenAPI schema for Goal
"""
use PlausibleWeb, :open_api_schema
OpenApiSpex.schema(%{
title: "CustomProp",
description: "Custom Property object",
type: :object,
required: [:custom_prop],
properties: %{
custom_prop: %Schema{
type: :object,
required: [:key],
properties: %{
key: %Schema{type: :string, description: "Custom Property Key"}
}
}
},
example: %{
custom_prop: %{
key: "author"
}
}
})
end