1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.ApiSpec.Schemas.BooleanLike do
6 alias OpenApiSpex.Schema
13 The following values will be treated as `false`:
24 All other non-null values will be treated as `true`
27 %Schema{type: :boolean},
28 %Schema{type: :string},
29 %Schema{type: :integer}
33 def after_cast(value, _schmea) do
34 {:ok, Pleroma.Web.ControllerHelper.truthy_param?(value)}