diff --git a/lib/trento_web/controllers/settings_controller.ex b/lib/trento_web/controllers/settings_controller.ex index 804b35408c..05add15c46 100644 --- a/lib/trento_web/controllers/settings_controller.ex +++ b/lib/trento_web/controllers/settings_controller.ex @@ -7,7 +7,13 @@ defmodule TrentoWeb.SettingsController do use OpenApiSpex.ControllerSpecs - operation :settings, false + operation :settings, + summary: "Platform Settings", + tags: ["Platform"], + description: "Provides the Platform Settings for the current installation.", + responses: [ + ok: {"Platform Settings", "application/json", Schema.Platform.Settings} + ] @spec settings(Plug.Conn.t(), any) :: Plug.Conn.t() def settings(conn, _) do diff --git a/lib/trento_web/openapi/schema/platform.ex b/lib/trento_web/openapi/schema/platform.ex new file mode 100644 index 0000000000..bcecf799cc --- /dev/null +++ b/lib/trento_web/openapi/schema/platform.ex @@ -0,0 +1,26 @@ +defmodule TrentoWeb.OpenApi.Schema.Platform do + @moduledoc false + + require OpenApiSpex + alias OpenApiSpex.Schema + + defmodule Settings do + @moduledoc false + + OpenApiSpex.schema(%{ + title: "PlatformSettings", + description: "Settings values for the current installation", + type: :object, + properties: %{ + eula_accepted: %Schema{ + type: :boolean, + description: "Whether the user has accepted EULA (on a Premium installation)" + }, + premium_subscription: %Schema{ + type: :boolean, + description: "Whether current installation is a Premium one" + } + } + }) + end +end